auth

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCookie = errors.New("invalid cookie")
	ErrNotInCache    = errors.New("item not found in cache")
)

Functions

This section is empty.

Types

type Session

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

Session stores a value in a cookie and encrypts it using encryption.Key. A Time To Live (TTL) is specified, this is the duration the client should hold onto the cookie.

func NewSession

func NewSession(ttl time.Duration, cookie string, secret encryption.Key) *Session

func (*Session) Delete

func (s *Session) Delete(c *gin.Context)

func (*Session) Get

func (s *Session) Get(c *gin.Context) (string, error)

func (*Session) Refresh

func (s *Session) Refresh(c *gin.Context) error

func (*Session) Store

func (s *Session) Store(value string, c *gin.Context)

func (*Session) TTL

func (s *Session) TTL() int

func (*Session) TimeLeft

func (s *Session) TimeLeft(c *gin.Context) (time.Duration, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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