session

package
v0.0.0-...-544bbf9 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSession

func GetSession() *sessions.CookieStore

Types

type Options

type Options struct {
	Name     string
	SecreKey string
	MaxAge   int
}

type Session

type Session struct {
	Store *sessions.CookieStore
	Name  string
}

func NewSession

func NewSession(o *Options) *Session

func (*Session) Clear

func (s *Session) Clear(w http.ResponseWriter, r *http.Request) (err error)

func (*Session) Delete

func (s *Session) Delete(w http.ResponseWriter, r *http.Request, key interface{}) (err error)

func (*Session) Get

func (s *Session) Get(r *http.Request, key string) (val interface{}, err error)

func (*Session) Session

func (s *Session) Session(r *http.Request) (session *sessions.Session)

func (*Session) Set

func (s *Session) Set(w http.ResponseWriter, r *http.Request, key interface{}, val interface{}) (err error)

Jump to

Keyboard shortcuts

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