logincookie

package
v0.0.0-...-4efb1cb Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNoLoginCookie = errors.New("No Login Cookie")
)

Functions

This section is empty.

Types

type CookieAuthentication

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

func NewCookieAuthentication

func NewCookieAuthentication(
	domain string, hmacKey []byte, aesKey []byte) *CookieAuthentication

func (*CookieAuthentication) DeleteLoginCookie

func (ch *CookieAuthentication) DeleteLoginCookie(w http.ResponseWriter)

func (*CookieAuthentication) GetLoginCookie

func (ch *CookieAuthentication) GetLoginCookie(r *http.Request) (li *LoginInfo, err error)

func (*CookieAuthentication) SetLoginCookie

func (ch *CookieAuthentication) SetLoginCookie(w http.ResponseWriter, loginInfo *LoginInfo)

type LoginInfo

type LoginInfo struct {
	ID       int
	Username string
	IsAdmin  bool
}

Jump to

Keyboard shortcuts

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