Documentation ¶
Index ¶
- type Config
- type UserConfig
- type UserStore
- func (us *UserStore) Close()
- func (us *UserStore) GetAllUsers() (users []*models.UserCredentials, err error)
- func (us *UserStore) GetByEmail(email string) (user *models.UserCredentials, err error)
- func (us *UserStore) GetByUserName(username string) (user *models.UserCredentials, err error)
- func (us *UserStore) RemoveByUserName(username string) (err error)
- func (us *UserStore) Set(user *models.UserCredentials) (err error)
- func (us *UserStore) UpdateUser(user *models.UserCredentials) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserConfig ¶
type UserConfig struct { // store users data collection name(The default is user) UsersCName string }
UserConfig user configuration parameters
func NewDefaultUserConfig ¶
func NewDefaultUserConfig() *UserConfig
NewDefaultUserConfig create a default user configuration
type UserStore ¶
type UserStore struct {
// contains filtered or unexported fields
}
UserStore MongoDB storage for OAuth 2.0
func NewUserStore ¶
func NewUserStore(cfg *Config, ucfgs ...*UserConfig) (*UserStore, error)
NewUserStore create a user store instance based on mongodb
func NewUserStoreWithSession ¶
func NewUserStoreWithSession(session *mgo.Session, dbName string, ucfgs ...*UserConfig) (*UserStore, error)
NewUserStoreWithSession create a User store instance based on mongodb
func (*UserStore) GetAllUsers ¶
func (us *UserStore) GetAllUsers() (users []*models.UserCredentials, err error)
GetAllUsers according to the ID for the user information
func (*UserStore) GetByEmail ¶
func (us *UserStore) GetByEmail(email string) (user *models.UserCredentials, err error)
GetByEmail according to the ID for the user information
func (*UserStore) GetByUserName ¶
func (us *UserStore) GetByUserName(username string) (user *models.UserCredentials, err error)
GetByUserName according to the ID for the user information
func (*UserStore) RemoveByUserName ¶
RemoveByUserName use the user id to delete the user information
func (*UserStore) Set ¶
func (us *UserStore) Set(user *models.UserCredentials) (err error)
Set set user information
func (*UserStore) UpdateUser ¶
func (us *UserStore) UpdateUser(user *models.UserCredentials) (err error)
UpdateUser updates the user
Click to show internal directories.
Click to hide internal directories.