cookies

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cookies provides tools for easy and quick work with http.Cookie.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set added in v1.0.8

func Set(
	writer http.ResponseWriter,
	name string,
	value string,
	config Config,
)

Types

type Config added in v1.0.8

type Config struct {
	Path    string        // optional
	Domain  string        // optional
	Expires time.Duration // optional

	// MaxAge=0 means no 'Max-Age' attribute specified.
	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
	// MaxAge>0 means Max-Age attribute present and given in seconds
	MaxAge   int
	Secure   bool
	HTTPOnly bool

	//	SameSiteDefaultMode SameSite = iota + 1 (1)
	//	SameSiteLaxMode (2)
	//	SameSiteStrictMode (3)
	//	SameSiteNoneMode (4)
	SameSite http.SameSite
}

type NotFoundError added in v1.0.8

type NotFoundError struct {
	Message string
	BaseErr error
}

func (NotFoundError) Error added in v1.0.8

func (e NotFoundError) Error() string

func (NotFoundError) Unwrap added in v1.2.11

func (e NotFoundError) Unwrap() error

Jump to

Keyboard shortcuts

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