cookie

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(base http.CookieJar, adapter JarAdapterFunc) http.CookieJar

Adapt wraps a CookieJar with an adaptor, which implements Cookies on top of base (SetCookies is provided by base)

func AllSupportedBrowsers

func AllSupportedBrowsers() (browsers []string)

func Concat

func Concat(base http.CookieJar, append http.CookieJar) http.CookieJar

Concat combines two CookieJar together, with Cookies as their concatenation, and SetCookies delegated to base.

func DeferredJarLoader added in v1.0.0

func DeferredJarLoader(loadFn func() (http.CookieJar, error)) http.CookieJar

DeferredJarLoader returns a http.CookieJar that lazily constructs its underlying jar (using loadFn) only on use.

func Load

func Load(extraSpecs []string, globals scope.ScopedBindings) (http.CookieJar, error)

func LoadSpec

func LoadSpec(spec string) (cookies []*http.Cookie, err error)

LoadSpec resolves "cookie specs" to cookies, based on format:

  • <name>=<value>: return as literal (no domain/path)
  • <filename> : loads filename from disk (Netscape format)

func LoadSpecs

func LoadSpecs(specs ...string) (cookies []*http.Cookie, err error)

func SimpleJar

func SimpleJar(cookies []*http.Cookie) (http.CookieJar, error)

Types

type JarAdapterFunc

type JarAdapterFunc func(u *url.URL, next http.CookieJar) []*http.Cookie

func HostAliasJarAdapter

func HostAliasJarAdapter(mapping map[string]*url.URL, afterAlias *hostalias.HostAlias) JarAdapterFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL