Documentation ¶
Overview ¶
Package cookies reads and modifies browser cookies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action int
An Action specifies the disposition of a cookie processed by the callback to the Scan method of a Store.
type C ¶
type C struct { Name string Value string Domain string Path string Expires time.Time // if zero, has no expiration Created time.Time Flags Flags SameSite SameSite }
C is a format-independent representation of a browser cookie.
type Editor ¶
type Editor interface { // Get returns a format-independent representation of the receiver. Get() C // Set updates the contents of the receiver to match c. // It reports an error if c cannot be represented in the format. Set(c C) error }
An Editor maps between format-specific representation of a cookie and the format-independent version.
type Flags ¶
type Flags struct { Secure bool // only send this cookie on an encrypted connection HTTPOnly bool // do not expose this cookie to scripts }
Flags represents the optional flags that can be set on a cookie.
type SameSite ¶
type SameSite int
SameSite describes a first-party cookie policy.
type Store ¶
type Store interface { // Scan calls f for each cookie in the store. // // If f reports an error, scanning stops and that error is returned to the // caller of Scan. Otherwise, the cookie is handled according to the Action // reported by f. // // if f returns Discard, the cookie is removed from the store. // // If f returns Update, the cookie is updated with any modifications made by // f via the Editor interface. // // If f returns Keep, the cookie is retained as-presented, and any // modifications made by f are discarded. // // If f returns an unknown Action value, Scan must report an error. Scan(f ScanFunc) error // Commit commits any pending modifications to persistent storage. Commit() error }
Store is the interface for a collection of cookies.
Directories ¶
Path | Synopsis |
---|---|
Package bincookie supports reading and modifying Apple binary cookie files.
|
Package bincookie supports reading and modifying Apple binary cookie files. |
Package chromedb supports reading and modifying a Chrome cookies database.
|
Package chromedb supports reading and modifying a Chrome cookies database. |
cmd
|
|
washcookies
Program washcookies cleans up browser cookies based on a policy.
|
Program washcookies cleans up browser cookies based on a policy. |
washcookies/config
Package config parses the text config file format for the washcookies tool.
|
Package config parses the text config file format for the washcookies tool. |
Package firefox supports reading and modifying a Firefox cookies database.
|
Package firefox supports reading and modifying a Firefox cookies database. |
Click to show internal directories.
Click to hide internal directories.