Documentation ¶
Index ¶
- type BoltStore
- func (s *BoltStore) Close() error
- func (s *BoltStore) DB() *bolt.DB
- func (s *BoltStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *BoltStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (s *BoltStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- type GobSerializer
- type JSONSerializer
- type Options
- type SessionSerializer
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltStore ¶
type BoltStore struct { Codecs []securecookie.Codec Options *sessions.Options // default session configuration // contains filtered or unexported fields }
boltstore stores sessions in a boltdb backend.
Example ¶
store, err := NewStore(context.Background(), "example.db", Options{}) if err != nil { panic(err) } defer store.Close()
Output:
func NewStoreWithDB ¶
NewStoreWithDB returns a new BoltStore.
func (*BoltStore) Get ¶
Get returns a session for the given name after adding it to the registry.
See gorilla/sessions FilesystemStore.Get().
type GobSerializer ¶
type GobSerializer struct{}
GobSerializer uses gob package to encode the session map
func (GobSerializer) Deserialize ¶
func (s GobSerializer) Deserialize(d []byte, ss *sessions.Session) error
Deserialize back to map[interface{}]interface{}
type JSONSerializer ¶
type JSONSerializer struct{}
JSONSerializer encode the session map to JSON.
func (JSONSerializer) Deserialize ¶
func (s JSONSerializer) Deserialize(d []byte, ss *sessions.Session) error
Deserialize back to map[string]interface{}
Click to show internal directories.
Click to hide internal directories.