Documentation
¶
Index ¶
- Constants
- func UpdateAccount(ctx context.Context, account *Account) error
- type Account
- func CreateAccount(ctx context.Context, realm, userID string, expires int) (*Account, error)
- func FindAccountByToken(ctx context.Context, token string) (*Account, error)
- func FindAccountByUserID(ctx context.Context, realm, userID string) (*Account, error)
- func LookupAccount(ctx context.Context, realm, clientID string) (*Account, error)
- func ResetAccountChallenge(ctx context.Context, acc *Account, expires int) (*Account, error)
Constants ¶
View Source
const ( // AccountActive indicates a confirmed account with a valid login AccountActive = 1 // AccountLoggedOut indicates a confirmed account without a valid login AccountLoggedOut = 0 // AccountDeactivated indicates an account that has been deactivated due to // e.g. account deletion or UserID swap AccountDeactivated = -1 // AccountBlocked signals an issue with the account that needs intervention AccountBlocked = -2 // AccountUnconfirmed well guess what? AccountUnconfirmed = -3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { Realm string `json:"realm"` // KEY UserID string `json:"user_id"` // KEY external id for the entity e.g. email for a user ClientID string `json:"client_id"` // a unique id within [realm,user_id] // status and other metadata Status int `json:"status"` // default == AccountUnconfirmed // login auditing LastLogin int64 `json:"-"` LoginCount int `json:"-"` LoginFrom string `json:"-"` // internal Ext1 string `json:"-"` // universal field, used as needed. e.g to confirm the account and then to request the real token Ext2 string `json:"-"` Expires int64 `json:"-"` // 0 == never Confirmed int64 `json:"-"` Created int64 `json:"-"` Updated int64 `json:"-"` }
Account represents an account for a user or client (e.g. API, bot)
func CreateAccount ¶
CreateAccount creates an new account within a given realm
func FindAccountByToken ¶
FindAccountByToken retrieves an account bases on either the temporary token or the auth token
func FindAccountByUserID ¶
FindAccountUserID retrieves an account bases on the user id
func LookupAccount ¶
LookupAccount retrieves an account within a given realm
Click to show internal directories.
Click to hide internal directories.