signedcookie

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretSize = 32 // SecretSize is the size, in bytes, of a cookie secret.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(secrets Secrets) (*Manager, error)

func (Manager) Delete added in v0.0.2

func (m Manager) Delete(w http.ResponseWriter, cookie *http.Cookie)

func (Manager) Get added in v0.0.2

func (m Manager) Get(r *http.Request, key string) (string, error)

func (Manager) Read

func (m Manager) Read(signedValue string) (string, error)

func (Manager) Set added in v0.0.2

func (m Manager) Set(w http.ResponseWriter, r *http.Request, cookie *http.Cookie) error

func (Manager) Sign

func (m Manager) Sign(rawValue string) (string, error)

type Secrets added in v0.0.2

type Secrets []string

CookieSecrets is a latest-first list of 32-byte, base64-encoded secrets.

Jump to

Keyboard shortcuts

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