signedcookie

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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(options ManagerOptions) (*Manager, error)

func (Manager) DeleteCookie

func (m Manager) DeleteCookie(w http.ResponseWriter, key string)

func (Manager) GetCookieValue

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

func (Manager) Read

func (m Manager) Read(key string, encodedValue string) (string, error)

func (Manager) SetCookie

func (m Manager) SetCookie(w http.ResponseWriter, r *http.Request, key string, value string) error

func (Manager) Sign

func (m Manager) Sign(key string, value string) (string, error)

type ManagerOptions

type ManagerOptions struct {
	CurrentCookieSecret  string // base64 encoded, 32 or 64 bytes
	PreviousCookieSecret string // base64 encoded, 32 or 64 bytes
	SameSite             http.SameSite
	Path                 string
}

Jump to

Keyboard shortcuts

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