cookies

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const (
	MaxAgeNotSet = 0
)

Variables

View Source
var GlobalJar = NewCookieJar()

Functions

func SetDOMCookie

func SetDOMCookie(name, value string)

Types

type Cookie struct {
	Name  string
	Value string

	Path    string
	Domain  string
	Expires time.Time

	// MaxAge=0 means no 'Max-Age' attribute specified.
	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
	// MaxAge>0 means Max-Age attribute present and given in seconds
	MaxAge   int
	Secure   bool
	HttpOnly bool
	SameSite SameSite
	Raw      string
}

func GetDOMCookie

func GetDOMCookie(name string) (Cookie, error)

func (*Cookie) IsValid

func (c *Cookie) IsValid() bool

func (*Cookie) String

func (c *Cookie) String() string

type CookieJar

type CookieJar struct {
	// contains filtered or unexported fields
}

func NewCookieJar

func NewCookieJar() *CookieJar

func (*CookieJar) All

func (cj *CookieJar) All() []Cookie

func (*CookieJar) DelCookie

func (cj *CookieJar) DelCookie(name string) error

func (*CookieJar) DelCookieIndex

func (cj *CookieJar) DelCookieIndex(index int) error

func (*CookieJar) Get

func (cj *CookieJar) Get(name string) (Cookie, error)

func (*CookieJar) SetCookie

func (cj *CookieJar) SetCookie(cookie Cookie) error

func (*CookieJar) SetHTTPCookie

func (cj *CookieJar) SetHTTPCookie(cookie *http.Cookie) error

func (*CookieJar) SetHTTPCookies

func (cj *CookieJar) SetHTTPCookies(cookies []*http.Cookie) error

func (*CookieJar) Stop

func (cj *CookieJar) Stop()

type SameSite

type SameSite int
const (
	SameSiteDefaultMode SameSite = iota + 1
	SameSiteLaxMode
	SameSiteStrictMode
	SameSiteNoneMode
)

Jump to

Keyboard shortcuts

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