Documentation ¶
Index ¶
- Constants
- type Session
- func (s *Session) End(ctx context.Context) error
- func (s *Session) GetInt(key string, def int) int
- func (s *Session) GetString(key, def string) string
- func (s *Session) ID() string
- func (s *Session) IsExpired() bool
- func (s *Session) Save(ctx context.Context) error
- func (s *Session) Set(key string, value interface{})
Constants ¶
View Source
const ( APIKeyKey = "api_key" LoginTimeKey = "login_time" LastActivityTimeKey = "last_activity_time" UserKey = "user_id" )
Session constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds user session information in memory.
func Load ¶
Load loads an existing Session object from the database.
The following errors are returned by this function: DBQueryFailure, SessionNotFound
func (*Session) GetInt ¶
GetInt gets the value of the given key using the default value if the key does not exist or is not an int.
func (*Session) GetString ¶
GetString gets the value of the given key using the default value if the key does not exist or is not a string.
Click to show internal directories.
Click to hide internal directories.