Documentation ¶
Index ¶
- type Store
- type Token
- type TokenProvider
- func (p *TokenProvider) CreateOne(uid, aid, t string, d time.Duration) (err error)
- func (p *TokenProvider) DeleteAppFamily(uid, aid string) (err error)
- func (p TokenProvider) DeleteByUser(uid string) (err error)
- func (p *TokenProvider) Exists(token string) (err error)
- func (p *TokenProvider) ReadLatestByIds(uid, aid string) (token string, err error)
- type User
- type UserProvider
- func (p *UserProvider) ReadOne(id uint, email string) (u User, err error)
- func (p *UserProvider) ReadPendingRegistration(k string) (email string, err error)
- func (p *UserProvider) ReadPendingResetPassword(k string) (email string, err error)
- func (p *UserProvider) ReadPendingUpdateEmail(k string) (user_id, email string, err error)
- func (p *UserProvider) Register(u User) (id uint, err error)
- func (p *UserProvider) ResetPassword(u User) (err error)
- func (p *UserProvider) UniqueEmail(e string) (unique bool, err error)
- func (p *UserProvider) UpdateEmail(uid, e string) (err error)
- func (p *UserProvider) UpdateOne(u User) (err error)
- func (p *UserProvider) UpsertPendingRegistration(e string) (key string, err error)
- func (p *UserProvider) UpsertPendingResetPassword(e string) (key string, err error)
- func (p *UserProvider) UpsertPendingUpdateEmail(uid, e string) (key string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { User *UserProvider Token *TokenProvider // contains filtered or unexported fields }
type TokenProvider ¶
func NewTokenProvider ¶
func NewTokenProvider(db *sql.DB) *TokenProvider
func (*TokenProvider) CreateOne ¶
func (p *TokenProvider) CreateOne(uid, aid, t string, d time.Duration) (err error)
func (*TokenProvider) DeleteAppFamily ¶
func (p *TokenProvider) DeleteAppFamily(uid, aid string) (err error)
func (TokenProvider) DeleteByUser ¶
func (p TokenProvider) DeleteByUser(uid string) (err error)
func (*TokenProvider) Exists ¶
func (p *TokenProvider) Exists(token string) (err error)
func (*TokenProvider) ReadLatestByIds ¶
func (p *TokenProvider) ReadLatestByIds(uid, aid string) (token string, err error)
type User ¶
type User struct { Id uint `json:"id"` DisplayName string `json:"display_name"` Email string `json:"email"` Password string `json:"-"` UpdatedAt time.Time `json:"-"` CreatedAt time.Time `json:"-"` ExpiredAt time.Time `json:"-"` }
func (*User) ComparePassword ¶
func (*User) SetPassword ¶
type UserProvider ¶
func NewUserProvider ¶
func NewUserProvider(db *sql.DB) *UserProvider
func (*UserProvider) ReadOne ¶
func (p *UserProvider) ReadOne(id uint, email string) (u User, err error)
Match against id or email
func (*UserProvider) ReadPendingRegistration ¶
func (p *UserProvider) ReadPendingRegistration(k string) (email string, err error)
func (*UserProvider) ReadPendingResetPassword ¶
func (p *UserProvider) ReadPendingResetPassword(k string) (email string, err error)
func (*UserProvider) ReadPendingUpdateEmail ¶
func (p *UserProvider) ReadPendingUpdateEmail(k string) (user_id, email string, err error)
func (*UserProvider) ResetPassword ¶
func (p *UserProvider) ResetPassword(u User) (err error)
func (*UserProvider) UniqueEmail ¶
func (p *UserProvider) UniqueEmail(e string) (unique bool, err error)
func (*UserProvider) UpdateEmail ¶
func (p *UserProvider) UpdateEmail(uid, e string) (err error)
func (*UserProvider) UpdateOne ¶
func (p *UserProvider) UpdateOne(u User) (err error)
func (*UserProvider) UpsertPendingRegistration ¶
func (p *UserProvider) UpsertPendingRegistration(e string) (key string, err error)
Upsert email and generate confirmation key
func (*UserProvider) UpsertPendingResetPassword ¶
func (p *UserProvider) UpsertPendingResetPassword(e string) (key string, err error)
Upsert email and generate confirmation key
func (*UserProvider) UpsertPendingUpdateEmail ¶
func (p *UserProvider) UpsertPendingUpdateEmail(uid, e string) (key string, err error)
Upsert email and generate confirmation key
Click to show internal directories.
Click to hide internal directories.