ck

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 4 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCookie

func ClearCookie(name string, rw http.ResponseWriter)

func NewCookie

func NewCookie(cookieName string) *http.Cookie

Types

type CookieValueMap

type CookieValueMap map[string]interface{}

type SafeCookie

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

func New

func New(hashKey []byte, blockKey []byte, maxAge int) *SafeCookie

func (*SafeCookie) GetSecureCookieValue

func (sc *SafeCookie) GetSecureCookieValue(r *http.Request, cookieName string) (cookieValue CookieValueMap, err error)

Get previous data if the value is nil will new an empty data.

func (*SafeCookie) SetSecureCookie

func (sc *SafeCookie) SetSecureCookie(cookie *http.Cookie, mapValue CookieValueMap, responseWriter http.ResponseWriter)

func (*SafeCookie) UpdateSecureCookie

func (sc *SafeCookie) UpdateSecureCookie(writer http.ResponseWriter, request *http.Request, cookieName string,
	updateMap map[string]interface{},
	path string, expires *time.Time,
) error

Jump to

Keyboard shortcuts

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