Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cookies

func Cookies(block, hash []byte) echo.MiddlewareFunc

Cookies is a middleware function that makes the handlers capable of handling cookies via methods of this package.

Types

type Cookie struct {
	// Name is the name of the cookie.
	Name string

	// Path is path of the cookie.
	Path string

	// MaxAge is the max age of the cookie.
	MaxAge time.Duration

	// HTTPOnly restricts the cookie to HTTP (no javascript access).
	HTTPOnly bool
}

Cookie is a description of a cookie used for consistent cookie setting and deleting.

func (*Cookie) Exists

func (d *Cookie) Exists(c echo.Context) bool

Exists checks if the cookies exists.

func (*Cookie) Get

func (d *Cookie) Get(c echo.Context, v interface{}) (bool, error)

Get decodes the cookie into the value. Returns false if the cookie is not there.

func (*Cookie) Remove

func (d *Cookie) Remove(c echo.Context)

Remove the cookie with the specified name (if it exists).

func (*Cookie) Set

func (d *Cookie) Set(c echo.Context, v interface{}) error

Set the value of the cookie.

Source Files