Documentation
¶
Index ¶
- type Session
- type SessionManager
- func (sm *SessionManager) Get(r *http.Request, name string) (*sessions.Session, error)
- func (sm *SessionManager) LoadSession(ctx context.Context, session *sessions.Session) error
- func (sm *SessionManager) New(r *http.Request, name string) (*sessions.Session, error)
- func (sm *SessionManager) Options(options sgin.Options)
- func (sm *SessionManager) Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
- func (sm *SessionManager) SaveSession(s *sessions.Session) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { Key string `json:"key"` Values string `json:"values"` ExpiresOn time.Time `json:"expires_on"` }
Session corresponds to the `sessions` table and encapsulates a web session.
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager manages many session objects.
func (*SessionManager) LoadSession ¶
LoadSession loads a session from the database.
func (*SessionManager) Options ¶
func (sm *SessionManager) Options(options sgin.Options)
Options sets the options for the session handler.
func (*SessionManager) Save ¶
func (sm *SessionManager) Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
Save persists the session for the given name. Also requires the http writer.
func (*SessionManager) SaveSession ¶
func (sm *SessionManager) SaveSession(s *sessions.Session) (string, error)
SaveSession saves the provided session with the codecs used.
Click to show internal directories.
Click to hide internal directories.