Documentation ¶
Index ¶
- type TokenStorage
- func (s *TokenStorage) CreateAccessToken(ctx context.Context, userID int64, token, chain string, valid bool) error
- func (s *TokenStorage) CreateRefreshToken(ctx context.Context, userID int64, token, chain string, valid bool) error
- func (s *TokenStorage) GetAccessToken(ctx context.Context, userID int64, token string) (papers.Token, error)
- func (s *TokenStorage) GetRefreshToken(ctx context.Context, userID int64, token string) (papers.Token, error)
- func (s *TokenStorage) InvalidateAccessTokens(ctx context.Context, userID int64) error
- func (s *TokenStorage) InvalidateRefreshToken(ctx context.Context, userID int64, token string) error
- func (s *TokenStorage) InvalidateRefreshTokens(ctx context.Context, userID int64) error
- func (s *TokenStorage) InvalidateTokenChain(ctx context.Context, userID int64, chain string) error
- func (s *TokenStorage) PruneAccessTokens(ctx context.Context, timeToStale time.Duration) error
- func (s *TokenStorage) PruneRefreshTokens(ctx context.Context, timeToStale time.Duration) error
- type User
- func (u *User) GetAttempts() int
- func (u *User) GetConfirmToken() string
- func (u *User) GetConfirmed() bool
- func (u *User) GetCreatedAt() time.Time
- func (u *User) GetEmail() string
- func (u *User) GetID() int64
- func (u *User) GetLastAttempt() time.Time
- func (u *User) GetLastLogin() time.Time
- func (u *User) GetLockedUntil() time.Time
- func (u *User) GetPassword() string
- func (u *User) GetRecoveryToken() string
- func (u *User) GetRoles() []string
- func (u *User) GetTOTPSecret() string
- func (u *User) GetUsername() string
- func (u *User) SetAttempts(attempts int)
- func (u *User) SetConfirmToken(token string)
- func (u *User) SetConfirmed(confirmed bool)
- func (u *User) SetCreatedAt(at time.Time)
- func (u *User) SetEmail(email string)
- func (u *User) SetID(id int64)
- func (u *User) SetLastAttempt(at time.Time)
- func (u *User) SetLastLogin(at time.Time)
- func (u *User) SetLockedUntil(until time.Time)
- func (u *User) SetPassword(password string)
- func (u *User) SetRecoveryToken(token string)
- func (u *User) SetRoles(roles []string)
- func (u *User) SetTOTPSecret(secret string)
- func (u *User) SetUsername(username string)
- type UserStorage
- func (s *UserStorage) CreateOAuth2Identity(ctx context.Context, user papers.User, provider, identity string) error
- func (s *UserStorage) CreateUser(ctx context.Context, user papers.User) error
- func (s *UserStorage) GetUserByConfirmationToken(ctx context.Context, token string) (papers.User, error)
- func (s *UserStorage) GetUserByEmail(ctx context.Context, email string) (papers.User, error)
- func (s *UserStorage) GetUserByID(ctx context.Context, id int64) (papers.User, error)
- func (s *UserStorage) GetUserByOAuth2Identity(ctx context.Context, provider, identity string) (papers.User, error)
- func (s *UserStorage) GetUserByRecoveryToken(ctx context.Context, token string) (papers.User, error)
- func (s *UserStorage) GetUserByUsername(ctx context.Context, username string) (papers.User, error)
- func (s *UserStorage) GetUserPermissions(ctx context.Context, user papers.User) ([]string, error)
- func (s *UserStorage) GetUserRoles(ctx context.Context, user papers.User) ([]string, error)
- func (s *UserStorage) NewUser() papers.User
- func (s *UserStorage) RemoveOAuth2Identity(ctx context.Context, user papers.User, provider, identity string) error
- func (s *UserStorage) UpdateUser(ctx context.Context, user papers.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenStorage ¶
type TokenStorage struct {
// contains filtered or unexported fields
}
func NewTokenStorage ¶
func NewTokenStorage(db *sql.DB) *TokenStorage
func (*TokenStorage) CreateAccessToken ¶
func (*TokenStorage) CreateRefreshToken ¶
func (*TokenStorage) GetAccessToken ¶
func (*TokenStorage) GetRefreshToken ¶
func (*TokenStorage) InvalidateAccessTokens ¶
func (s *TokenStorage) InvalidateAccessTokens(ctx context.Context, userID int64) error
func (*TokenStorage) InvalidateRefreshToken ¶
func (*TokenStorage) InvalidateRefreshTokens ¶
func (s *TokenStorage) InvalidateRefreshTokens(ctx context.Context, userID int64) error
func (*TokenStorage) InvalidateTokenChain ¶
func (*TokenStorage) PruneAccessTokens ¶
func (*TokenStorage) PruneRefreshTokens ¶
type User ¶
func (*User) GetAttempts ¶
func (*User) GetConfirmToken ¶
func (*User) GetConfirmed ¶
func (*User) GetCreatedAt ¶
func (*User) GetLastAttempt ¶
func (*User) GetLastLogin ¶
func (*User) GetLockedUntil ¶
func (*User) GetPassword ¶
func (*User) GetRecoveryToken ¶
func (*User) GetTOTPSecret ¶
func (*User) GetUsername ¶
func (*User) SetAttempts ¶
func (*User) SetConfirmToken ¶
func (*User) SetConfirmed ¶
func (*User) SetCreatedAt ¶
func (*User) SetLastAttempt ¶
func (*User) SetLastLogin ¶
func (*User) SetLockedUntil ¶
func (*User) SetPassword ¶
func (*User) SetRecoveryToken ¶
func (*User) SetTOTPSecret ¶
func (*User) SetUsername ¶
type UserStorage ¶
type UserStorage struct {
// contains filtered or unexported fields
}
func NewUserStorage ¶
func NewUserStorage(db *sql.DB) *UserStorage
func (*UserStorage) CreateOAuth2Identity ¶
func (*UserStorage) CreateUser ¶
func (*UserStorage) GetUserByConfirmationToken ¶
func (*UserStorage) GetUserByEmail ¶
func (*UserStorage) GetUserByID ¶
func (*UserStorage) GetUserByOAuth2Identity ¶
func (*UserStorage) GetUserByRecoveryToken ¶
func (*UserStorage) GetUserByUsername ¶
func (*UserStorage) GetUserPermissions ¶
func (*UserStorage) GetUserRoles ¶
func (*UserStorage) NewUser ¶
func (s *UserStorage) NewUser() papers.User
func (*UserStorage) RemoveOAuth2Identity ¶
func (*UserStorage) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.