Documentation ¶
Index ¶
- type Session
- func (s *Session) Delete(ctx context.Context, db redis.UniversalClient) error
- func (s Session) Expiration() time.Duration
- func (s Session) Key() string
- func (s *Session) Load(ctx context.Context, db redis.UniversalClient) error
- func (s *Session) Update(ctx context.Context, db redis.UniversalClient) error
- type SessionTime
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { // ID is the session ID ID string `json:"id"` UserID string `json:"user_id"` RemoteAddr string `json:"remote_addr"` Time *SessionTime `json:"time"` }
func NewSession ¶
func (Session) Expiration ¶
type SessionTime ¶
type SessionTime struct { // MaxTime is the time when the session will expire and won't be able to be renewed MaxTime time.Time `json:"max_time"` // MaxRenewTime is the time when the session won't be able to be renewed MaxRenewTime time.Time `json:"max_renew_time"` // ExpirationTime is the time when the session will expire if it's not renewed ExpirationTime time.Time `json:"expiration_time"` }
SessionTime contains all the information related with the lifespan of the session
Click to show internal directories.
Click to hide internal directories.