Documentation ¶
Index ¶
- Variables
- func BuildRandomToken() string
- func DestroySession(token string)
- func LoadSessions()
- func SaveSessions()
- type Session
- func (session *Session) Get(key string) (value interface{}, ok bool)
- func (session *Session) GetDef(key string, def interface{}) interface{}
- func (session *Session) GetInt(key string) (value int, ok bool)
- func (session *Session) GetIntDef(key string, def int) int
- func (session *Session) GetString(key string) (value string, ok bool)
- func (session *Session) GetStringDef(key string, def string) string
- func (session *Session) Set(key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var GeneralMutex sync.Mutex
Functions ¶
func BuildRandomToken ¶
func BuildRandomToken() string
BuildRandomToken build a random string used for token.
func SaveSessions ¶
func SaveSessions()
Types ¶
type Session ¶
type Session struct { LastAccess time.Time Values map[string]interface{} // contains filtered or unexported fields }
Session struct
func GetSession ¶
GetSession return the Session instance of the given token. if no session was found for this token, a transient session will be given
func NewSession ¶
NewSession return a new Session instance, with a new token.
func (*Session) GetDef ¶
GetDef return a value of any type. return the "def" parameter if no value was found
func (*Session) GetIntDef ¶
GetIntDef return a value of integer type. return the "def" parameter if no value was found
func (*Session) GetString ¶
GetString return a value of string type. ok is false if no value was found
func (*Session) GetStringDef ¶
GetStringDef return a value of string type. return the "def" parameter if no value was found
Click to show internal directories.
Click to hide internal directories.