Documentation ¶
Index ¶
- type EncryptedStorage
- type Encrypter
- type JSONSession
- type Session
- func (s *Session) CSRF(r *http.Request) bool
- func (s *Session) Logout(r *http.Request)
- func (s *Session) RememberMe(r *http.Request, value bool)
- func (s *Session) SetCSRF(r *http.Request) string
- func (s *Session) SetString(r *http.Request, name string, value string)
- func (s *Session) SetUser(r *http.Request, value string)
- func (s *Session) String(r *http.Request, name string) string
- func (s *Session) User(r *http.Request) (string, bool)
- type SessionData
- type SessionDatabase
- type Sessionstorer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedStorage ¶
type EncryptedStorage struct {
// contains filtered or unexported fields
}
EncryptedStorage -
func NewEncryptedStorage ¶
func NewEncryptedStorage(privatekey string) *EncryptedStorage
NewEncryptedStorage -
type Encrypter ¶
type Encrypter interface { Encrypt(data []byte) (encrypted []byte, err error) Decrypt(data []byte) (decrypted []byte, err error) }
Encrypter -
type JSONSession ¶
type JSONSession struct {
// contains filtered or unexported fields
}
JSONSession -
func NewJSONSession ¶
func NewJSONSession(sd Sessionstorer, encrypter Encrypter) (*JSONSession, error)
NewJSONSession -
func (*JSONSession) Commit ¶
Commit adds a session token and data to the store with the given expiry time. If the session token already exists then the data and expiry time are updated.
func (*JSONSession) Delete ¶
func (s *JSONSession) Delete(token string) error
Delete removes a session token and corresponding data from the store.
type Session ¶
type Session struct { Name string // contains filtered or unexported fields }
Session stores session level information
type SessionData ¶
type SessionData struct { ID string `json:"id"` Data []byte `json:"data"` Expire time.Time `json:"expire"` }
SessionData -
type SessionDatabase ¶
type SessionDatabase struct {
Records map[string]SessionData `json:"db"`
}
SessionDatabase -
func (*SessionDatabase) Load ¶
func (sd *SessionDatabase) Load(ss Sessionstorer, en Encrypter) error
Load -
func (*SessionDatabase) Save ¶
func (sd *SessionDatabase) Save(ss Sessionstorer, en Encrypter) error
Save -
Click to show internal directories.
Click to hide internal directories.