// Generated by Lisette bindgen
// Source: net/http/cookiejar (Go stdlib)
// Go: 1.25.10
// Lisette: 0.2.1

import "go:net/http"
import "go:net/url"

/// New returns a new cookie jar. A nil [*Options] is equivalent to a zero
/// Options.
pub fn New(o: Ref<Options>) -> Result<Ref<Jar>, error>

/// Jar implements the http.CookieJar interface from the net/http package.
pub type Jar

/// Options are the options for creating a new Jar.
pub struct Options {
  pub PublicSuffixList: Option<PublicSuffixList>,
}

/// PublicSuffixList provides the public suffix of a domain. For example:
///   - the public suffix of "example.com" is "com",
///   - the public suffix of "foo1.foo2.foo3.co.uk" is "co.uk", and
///   - the public suffix of "bar.pvt.k12.ma.us" is "pvt.k12.ma.us".
/// 
/// Implementations of PublicSuffixList must be safe for concurrent use by
/// multiple goroutines.
/// 
/// An implementation that always returns "" is valid and may be useful for
/// testing but it is not secure: it means that the HTTP server for foo.com can
/// set a cookie for bar.com.
/// 
/// A public suffix list implementation is in the package
/// golang.org/x/net/publicsuffix.
pub interface PublicSuffixList {
  fn PublicSuffix(domain: string) -> string
  fn String() -> string
}

impl Jar {
  /// Cookies implements the Cookies method of the [http.CookieJar] interface.
  /// 
  /// It returns an empty slice if the URL's scheme is not HTTP or HTTPS.
  fn Cookies(self: Ref<Jar>, u: Ref<url.URL>) -> Slice<Ref<http.Cookie>>

  /// SetCookies implements the SetCookies method of the [http.CookieJar] interface.
  /// 
  /// It does nothing if the URL's scheme is not HTTP or HTTPS.
  fn SetCookies(
    self: Ref<Jar>,
    u: Ref<url.URL>,
    cookies: Slice<Ref<http.Cookie>>,
  )
}
