gorilla

package
v0.0.0-...-6653ad0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecureCookie

type SecureCookie struct {
	Path     string
	Domain   string
	Secure   bool
	HttpOnly bool
	// contains filtered or unexported fields
}

func NewSecureCookie

func NewSecureCookie(hashKey []byte, blockKey []byte) *SecureCookie

Creates a new SecureCookie instance hashKey verifies the authenticity of the cookie using HMAC and should be at least 32 bytes (preferably 32 or 64 bytes) blockKey encrypts the cookie using AES-128, AES-192, or AES-256, and must be 16, 24, or 32 bytes respectively. A nil blockKey disables encryption

func (SecureCookie) Read

func (c SecureCookie) Read(name string, r *http.Request, value interface{}) error

func (SecureCookie) Remove

func (c SecureCookie) Remove(name string, w http.ResponseWriter)

func (SecureCookie) Write

func (c SecureCookie) Write(name string, w http.ResponseWriter, maxAge time.Duration, value interface{}) error

type Session

type Session struct {
	Name       string
	ContextKey string
	// contains filtered or unexported fields
}

func NewSession

func NewSession(name string, contextKey string, maxAge time.Duration, keyPairs ...[]byte) *Session

Creates a new Session instance hashKey verifies the authenticity of the cookie using HMAC and should be at least 32 bytes (preferably 32 or 64 bytes) blockKey encrypts the cookie using AES-128, AES-192, or AES-256, and must be 16, 24, or 32 bytes respectively. A nil blockKey disables encryption

func (Session) Delete

func (s Session) Delete(r *http.Request, key string) error

func (Session) Get

func (s Session) Get(r *http.Request, key string) (string, error)

func (Session) MultiDelete

func (s Session) MultiDelete(r *http.Request, keys []string) error

func (Session) MultiSet

func (s Session) MultiSet(r *http.Request, vals map[string]string) error

func (Session) Set

func (s Session) Set(r *http.Request, key, value string) error

func (Session) Write

func (s Session) Write(r *http.Request, w http.ResponseWriter) error

Jump to

Keyboard shortcuts

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