cookie

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Cookie provides an abstraction of cookie in rocket

func Forget

func Forget(name string) *Cookie

Forget would delete the cookie that name is provided name

func New

func New(name, value string) *Cookie

New create a new cookie

func (*Cookie) Domain

func (c *Cookie) Domain(domain string) *Cookie

Domain set domain of cookie

func (*Cookie) Expires

func (c *Cookie) Expires(time time.Time) *Cookie

Expires set expires of cookie

func (*Cookie) Generate

func (c *Cookie) Generate() *http.Cookie

Generate is not prepare for you

func (*Cookie) MaxAge added in v0.13.0

func (c *Cookie) MaxAge(maxAge int) *Cookie

MaxAge is set function for maxAge of Cookie

* 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

func (*Cookie) Path

func (c *Cookie) Path(path string) *Cookie

Path set path of cookie

Jump to

Keyboard shortcuts

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