cookies

package
v3.0.8 Latest Latest
Warning

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

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

Documentation

Overview

Package cookies implements a persistent cookie jar which satisfies the http.CookieJar interface.

Index

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 implements http.CookieJar by wrapping the standard library's cookiejar.Jar. The jar uses a pantry to load cookies at startup and save cookies when set.

func NewCookieJar

func NewCookieJar(jar http.CookieJar, persister Persister) (*Jar, error)

func (*Jar) Cookies

func (j *Jar) Cookies(u *url.URL) []*http.Cookie

func (*Jar) PersistCookies

func (j *Jar) PersistCookies() error

PersistCookies persists the cookies to disk.

func (*Jar) SetCookies

func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)

type Persister

type Persister interface {
	GetCookies() ([]byte, error)
	SetCookies([]byte) error
}

Jump to

Keyboard shortcuts

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