cookie

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 15 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 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 HostAliasJarAdapter

type HostAliasJarAdapter map[string]*url.URL

func (HostAliasJarAdapter) Adapt

func (haja HostAliasJarAdapter) Adapt(u *url.URL, next http.CookieJar) []*http.Cookie

type JarAdapterFunc

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

Jump to

Keyboard shortcuts

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