session

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CookieName = "session"

	Expiration      = time.Hour * 24 * 7
	RefreshInterval = time.Hour
)

Functions

This section is empty.

Types

type Session

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

func New

func New(id uint64) (*Session, error)

func (*Session) Expired

func (s *Session) Expired() bool

func (*Session) Key

func (s *Session) Key() string

func (*Session) Marshal

func (d *Session) Marshal(buf []byte) ([]byte, error)

func (*Session) Refresh

func (s *Session) Refresh() (string, error)

func (*Session) SetCookie

func (s *Session) SetCookie(w http.ResponseWriter, r *http.Request)

func (*Session) Size

func (d *Session) Size() (s uint64)

func (*Session) Unmarshal

func (d *Session) Unmarshal(buf []byte) (uint64, error)

Jump to

Keyboard shortcuts

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