Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultSessionExpiryTime = time.Hour * 24 * 15
)
expiry time list
Variables ¶
View Source
var (
ErrSessionNotFound error = errors.New("session: not found")
)
list of error
Functions ¶
Types ¶
type AuthData ¶
type AuthData struct { Provider authentity.Provider `json:"provider"` Action authentity.Action `json:"action"` }
AuthData struct
type Session ¶
type Session struct { ID string `json:"id"` HashID string `json:"hash_id"` AuthData AuthData `json:"auth_data"` Authenticated bool `json:"authenticated"` ExpiryTime time.Duration `json:"expiry_time"` ExpiredAt time.Time `json:"expired_at"` CreatedAt time.Time `json:"created_at"` }
Session struct
func FromContext ¶
FromContext return a session instance from requestContext
type UserData ¶
type UserData struct { User userentity.User `json:"user"` Bio userentity.Bio `json:"bio"` }
UserData session is a user data cache that assosiated to session of user
Click to show internal directories.
Click to hide internal directories.