Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteSessionByTokenRequest ¶
type DeleteSessionByTokenRequest struct {
Token string `json:"-"`
}
type DeleteSessionRequest ¶
type DeleteSessionRequest struct {
ID uint64 `json:"-"`
}
type GetUserActiveSessionsRequest ¶
type GetUserActiveSessionsRequest struct {
UserID uint64 `json:"-"`
}
type OAuthSignRequest ¶
type OAuthSignRequest struct { FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Email string `json:"email,omitempty"` }
func (OAuthSignRequest) Validate ¶
func (r OAuthSignRequest) Validate() error
type PersistenceProvider ¶
type PersistenceProvider interface {
SessionPersister() Persister
}
type Persister ¶
type Persister interface { FindSession(context.Context, uint64) (*Session, error) FindSessionByToken(context.Context, string) (*Session, error) FindUserSessions(context.Context, uint64) ([]*Session, error) CreateSession(context.Context, *Session) error RemoveSession(context.Context, uint64) error RemoveUserSessions(context.Context, uint64, ...string) error }
type Properties ¶
type Properties struct { IPLocation *ip.IPLocation `json:"ip_location,omitempty"` UAInfo *httplib.UAInfo `json:"ua_info,omitempty"` }
type Service ¶
type Service interface { GetSession(context.Context, string) (*Session, error) GetUserActiveSessions(context.Context, *GetUserActiveSessionsRequest) (*GetUserActiveSessionsResponse, error) DeleteSession(context.Context, *DeleteSessionRequest) error DeleteSessionByToken(context.Context, *DeleteSessionByTokenRequest) error IssueSession(context.Context, *SigninRequest) (*Session, error) OAuthIssueSession(context.Context, *OAuthSignRequest) (*Session, error) }
type ServiceProvider ¶
type ServiceProvider interface {
SessionService() Service
}
type Session ¶
type Session struct { ID uint64 `xorm:"pk 'id'" json:"id"` UserID uint64 `xorm:"'user_id'" json:"-"` Token string `xorm:"varchar(50) not null unique" json:"-"` Active bool `xorm:"not null" json:"-"` IssuedAt time.Time `xorm:"not null" json:"issued_at"` ExpiresAt time.Time `xorm:"not null" json:"-"` Properties *Properties `xorm:"json" json:"properties"` CreatedAt time.Time `xorm:"created" json:"-"` UpdatedAt time.Time `xorm:"updated" json:"-"` DeletedAt time.Time `xorm:"deleted" json:"-"` }
func (*Session) SetIPLocation ¶
func (s *Session) SetIPLocation(ipl *ip.IPLocation) *Session
type SigninRequest ¶
type SigninRequest struct { Identifier string `json:"identifier,omitempty"` Password string `json:"password,omitempty"` Remember bool `json:"remember,omitempty"` }
func (SigninRequest) Validate ¶
func (r SigninRequest) Validate() error
Click to show internal directories.
Click to hide internal directories.