Documentation ¶
Index ¶
- type InMemDB
- func (db *InMemDB) AddRememberToken(_ context.Context, pid, t string) error
- func (db *InMemDB) Create(_ context.Context, u authboss.User) error
- func (db *InMemDB) DelRememberTokens(_ context.Context, pid string) error
- func (db *InMemDB) Load(_ context.Context, id string) (authboss.User, error)
- func (db *InMemDB) LoadByConfirmSelector(_ context.Context, selector string) (user authboss.ConfirmableUser, err error)
- func (db *InMemDB) LoadByRecoverSelector(_ context.Context, selector string) (user authboss.RecoverableUser, err error)
- func (db *InMemDB) New(_ context.Context) authboss.User
- func (db *InMemDB) Save(_ context.Context, u authboss.User) error
- func (db *InMemDB) UseRememberToken(_ context.Context, pid, token string) error
- type User
- func (u User) GetArbitrary() map[string]string
- func (u User) GetAttemptCount() int
- func (u User) GetConfirmSelector() string
- func (u User) GetConfirmVerifier() string
- func (u User) GetConfirmed() bool
- func (u User) GetEmail() string
- func (u User) GetLastAttempt() time.Time
- func (u User) GetLocked() time.Time
- func (u User) GetOAuth2AccessToken() (token string)
- func (u User) GetOAuth2Expiry() (expiry time.Time)
- func (u User) GetOAuth2Provider() (provider string)
- func (u User) GetOAuth2RefreshToken() (refreshToken string)
- func (u User) GetOAuth2UID() (uid string)
- func (u User) GetPID() string
- func (u User) GetPassword() string
- func (u User) GetRecoverExpiry() time.Time
- func (u User) GetRecoverSelector() string
- func (u User) GetRecoverVerifier() string
- func (u User) IsOAuth2User() bool
- func (u *User) PutArbitrary(values map[string]string)
- func (u *User) PutAttemptCount(attempts int)
- func (u *User) PutConfirmSelector(confirmSelector string)
- func (u *User) PutConfirmVerifier(confirmVerifier string)
- func (u *User) PutConfirmed(confirmed bool)
- func (u *User) PutEmail(email string)
- func (u *User) PutLastAttempt(last time.Time)
- func (u *User) PutLocked(locked time.Time)
- func (u *User) PutOAuth2AccessToken(token string)
- func (u *User) PutOAuth2Expiry(expiry time.Time)
- func (u *User) PutOAuth2Provider(provider string)
- func (u *User) PutOAuth2RefreshToken(refreshToken string)
- func (u *User) PutOAuth2UID(uid string)
- func (u *User) PutPID(pid string)
- func (u *User) PutPassword(password string)
- func (u *User) PutRecoverExpiry(expiry time.Time)
- func (u *User) PutRecoverSelector(token string)
- func (u *User) PutRecoverVerifier(token string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemDB ¶
InMemDB : A generic in memory database
var DB *InMemDB
DB : The in memory database instance
func (*InMemDB) AddRememberToken ¶
AddRememberToken to a user
func (*InMemDB) DelRememberTokens ¶
DelRememberTokens removes all tokens for the given pid
func (*InMemDB) LoadByConfirmSelector ¶
func (db *InMemDB) LoadByConfirmSelector(_ context.Context, selector string) (user authboss.ConfirmableUser, err error)
LoadByConfirmSelector looks a user up by confirmation token
func (*InMemDB) LoadByRecoverSelector ¶
func (db *InMemDB) LoadByRecoverSelector(_ context.Context, selector string) (user authboss.RecoverableUser, err error)
LoadByRecoverSelector looks a user up by confirmation selector
type User ¶
type User struct { ID string Name string // Authable Email string Password string // Recoverable RecoverSelector string RecoverVerifier string RecoverTokenExpiry time.Time // Confirmable ConfirmSelector string ConfirmVerifier string Confirmed bool // Lockable AttemptCount int LastAttempt time.Time Locked time.Time // OAuthable OAuth2UID string OAuth2Provider string OAuth2AccessToken string OAuth2RefreshToken string OAuth2Expiry time.Time // Rememberable RememberTokens []string }
User database model
func (User) GetArbitrary ¶
GetArbitrary data from user
func (User) GetConfirmSelector ¶
GetConfirmSelector from user
func (User) GetConfirmVerifier ¶
GetConfirmVerifier from user
func (User) GetOAuth2AccessToken ¶
GetOAuth2AccessToken from user
func (User) GetOAuth2Expiry ¶
GetOAuth2Expiry from user
func (User) GetOAuth2Provider ¶
GetOAuth2Provider from user
func (User) GetOAuth2RefreshToken ¶
GetOAuth2RefreshToken from user
func (User) GetRecoverExpiry ¶
GetRecoverExpiry from user
func (User) GetRecoverSelector ¶
GetRecoverSelector from user
func (User) GetRecoverVerifier ¶
GetRecoverVerifier from user
func (User) IsOAuth2User ¶
IsOAuth2User returns true if the user was created with oauth2
func (*User) PutArbitrary ¶
PutArbitrary data from user
func (*User) PutAttemptCount ¶
PutAttemptCount into user
func (*User) PutConfirmSelector ¶
PutConfirmSelector into user
func (*User) PutConfirmVerifier ¶
PutConfirmVerifier into user
func (*User) PutLastAttempt ¶
PutLastAttempt into user
func (*User) PutOAuth2AccessToken ¶
PutOAuth2AccessToken into user
func (*User) PutOAuth2Expiry ¶
PutOAuth2Expiry into user
func (*User) PutOAuth2Provider ¶
PutOAuth2Provider into user
func (*User) PutOAuth2RefreshToken ¶
PutOAuth2RefreshToken into user
func (*User) PutRecoverExpiry ¶
PutRecoverExpiry into user
func (*User) PutRecoverSelector ¶
PutRecoverSelector into user
func (*User) PutRecoverVerifier ¶
PutRecoverVerifier into user