Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Length of the session token in bytes.
TOKEN_SIZE = 64
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type SessionStore ¶
type SessionStore struct { Sessions map[string]*session CookieName string // contains filtered or unexported fields }
func NewSessionStore ¶
func NewSessionStore(cookie string) *SessionStore
Creates a new session store.
func (*SessionStore) Create ¶
func (s *SessionStore) Create(timeout time.Duration) (string, error)
Creates a new session with the given expiration time.
func (*SessionStore) Delete ¶
func (s *SessionStore) Delete(token string)
Deletes a session form the session store.
func (*SessionStore) Refresh ¶
func (s *SessionStore) Refresh(token string)
Refreshs the given session.
func (*SessionStore) ValidateRequest ¶
func (s *SessionStore) ValidateRequest(r *http.Request) (string, error)
Checks if the given token belongs to a valid session.
Click to show internal directories.
Click to hide internal directories.