memory

package
v3.0.0-rc.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Provider the memory provider
	Provider = sessions.NewProvider("memory")
)

Functions

This section is empty.

Types

type Store

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

Store the memory store, contains the session id and the values

func (*Store) Clear

func (s *Store) Clear() error

Clear removes all entries returns an error, which is always nil

func (*Store) Delete

func (s *Store) Delete(key interface{}) error

Delete removes an entry by its key returns an error, which is always nil

func (*Store) Destroy

func (s *Store) Destroy()

Destroy does nothing here, to destroy the session use the manager's .Destroy func

func (*Store) Get

func (s *Store) Get(key interface{}) interface{}

Get returns the value of an entry by its key

func (*Store) GetAll

func (s *Store) GetAll() map[interface{}]interface{}

GetAll returns all values

func (*Store) GetInt

func (s *Store) GetInt(key interface{}) int

GetInt same as Get but returns as int, if nil then returns -1

func (*Store) GetString

func (s *Store) GetString(key interface{}) string

GetString same as Get but returns as string, if nil then returns an empty string

func (*Store) ID

func (s *Store) ID() string

ID returns the session id

func (*Store) LastAccessedTime

func (s *Store) LastAccessedTime() time.Time

LastAccessedTime returns the last time this session has been used

func (*Store) Set

func (s *Store) Set(key interface{}, value interface{}) error

Set fills the session with an entry, it receives a key and a value returns an error, which is always nil

func (*Store) SetLastAccessedTime

func (s *Store) SetLastAccessedTime(lastacc time.Time)

SetLastAccessedTime updates the last accessed time

func (*Store) VisitAll

func (s *Store) VisitAll(cb func(k interface{}, v interface{}))

VisitAll loop each one entry and calls the callback function func(key,value)

Jump to

Keyboard shortcuts

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