Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCookieJarFile ¶
LoadCookieJarFile takes a path to a curl (netscape) cookie jar file and crates a go http.CookieJar with the contents
By default LoadCookieJarFile stops at the first malformed line and returns an error naming it. Pass WithLenient to skip those lines instead, and WithMalformedLineHandler to see which lines it skipped.
Types ¶
type Option ¶ added in v1.1.0
type Option func(*config)
Option configures LoadCookieJarFile.
func WithLenient ¶ added in v1.1.0
func WithLenient() Option
WithLenient causes LoadCookieJarFile to skip malformed lines rather than returning an error for them.
This covers lines that fail to parse. If LoadCookieJarFile cannot read the file at all it still returns an error, since that leaves the cookie jar truncated at an arbitrary point.
func WithMalformedLineHandler ¶ added in v1.1.0
WithMalformedLineHandler registers a function to call for each malformed line LoadCookieJarFile skips. Lenient mode gives no other sign that it dropped a line, so without a handler you cannot tell what the file lost. Strict mode never calls the handler, since it reports the bad line through its error.