Documentation
¶
Overview ¶
Package cookie implements an HTTP cookie jar with thread-safe storage and automatic cookie management for HTTP clients.
Index ¶
- type Jar
- func (j *Jar) CleanExpired()
- func (j *Jar) Clear()
- func (j *Jar) ClearHost(host string)
- func (j *Jar) Cookies(u *url.URL) []*http.Cookie
- func (j *Jar) Count() int
- func (j *Jar) DeleteCookie(u *url.URL, name string)
- func (j *Jar) GetCookie(u *url.URL, name string) *http.Cookie
- func (j *Jar) SetCookie(u *url.URL, cookie *http.Cookie)
- func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Jar ¶
type Jar struct {
// contains filtered or unexported fields
}
Jar is a thread-safe cookie jar that stores cookies per host. It implements http.CookieJar interface for compatibility.
func (*Jar) CleanExpired ¶
func (j *Jar) CleanExpired()
CleanExpired removes all expired cookies from the jar.
func (*Jar) Cookies ¶
Cookies returns cookies for the given URL. Implements http.CookieJar interface.
func (*Jar) DeleteCookie ¶
DeleteCookie removes a cookie by name for the given URL.
func (*Jar) GetCookie ¶
GetCookie returns a specific cookie by name for the given URL, or nil if not found.
Click to show internal directories.
Click to hide internal directories.