Documentation ¶
Index ¶
- type MongoAdapter
- func (adapter *MongoAdapter) CreateUser(user *waechter.User) error
- func (adapter *MongoAdapter) FindRefreshToken(userID string, tokenID string) (*waechter.RefreshToken, error)
- func (adapter *MongoAdapter) GetUserByEmail(email string) (*waechter.User, error)
- func (adapter *MongoAdapter) GetUserByID(id string) (*waechter.User, error)
- func (adapter *MongoAdapter) GetUserByUsername(username string) (*waechter.User, error)
- func (adapter *MongoAdapter) GetUserByUsernameOrEmail(input string) (*waechter.User, error)
- func (adapter *MongoAdapter) InsertRefreshToken(token *waechter.RefreshToken) error
- func (adapter *MongoAdapter) SetForgotPasswordToken(userID string, token string) error
- func (adapter *MongoAdapter) SetPassword(userID string, hash string) error
- func (adapter *MongoAdapter) SetVerificationToken(userID string, token string) error
- func (adapter *MongoAdapter) VerifyEmail(userID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoAdapter ¶
MongoAdapter is a ready adapter to connect go-waechter to mongodb
func NewMongoAdapter ¶
func NewMongoAdapter(address string, db string) *MongoAdapter
NewMongoAdapter creates a new mongodb adapter
func (*MongoAdapter) CreateUser ¶
func (adapter *MongoAdapter) CreateUser(user *waechter.User) error
CreateUser insert new user in DB
func (*MongoAdapter) FindRefreshToken ¶
func (adapter *MongoAdapter) FindRefreshToken(userID string, tokenID string) (*waechter.RefreshToken, error)
FindRefreshToken retrieve by userID and tokenID
func (*MongoAdapter) GetUserByEmail ¶
func (adapter *MongoAdapter) GetUserByEmail(email string) (*waechter.User, error)
GetUserByEmail get user by email
func (*MongoAdapter) GetUserByID ¶
func (adapter *MongoAdapter) GetUserByID(id string) (*waechter.User, error)
GetUserByID get user by ID
func (*MongoAdapter) GetUserByUsername ¶
func (adapter *MongoAdapter) GetUserByUsername(username string) (*waechter.User, error)
GetUserByUsername get user by username
func (*MongoAdapter) GetUserByUsernameOrEmail ¶
func (adapter *MongoAdapter) GetUserByUsernameOrEmail(input string) (*waechter.User, error)
GetUserByUsernameOrEmail get user by username or email
func (*MongoAdapter) InsertRefreshToken ¶
func (adapter *MongoAdapter) InsertRefreshToken(token *waechter.RefreshToken) error
InsertRefreshToken insert a token
func (*MongoAdapter) SetForgotPasswordToken ¶
func (adapter *MongoAdapter) SetForgotPasswordToken(userID string, token string) error
SetForgotPasswordToken writes a "forgotPasswordToken" to the db
func (*MongoAdapter) SetPassword ¶
func (adapter *MongoAdapter) SetPassword(userID string, hash string) error
SetPassword sets the password
func (*MongoAdapter) SetVerificationToken ¶
func (adapter *MongoAdapter) SetVerificationToken(userID string, token string) error
SetVerificationToken writes a "verificationToken" to the db
func (*MongoAdapter) VerifyEmail ¶
func (adapter *MongoAdapter) VerifyEmail(userID string) error
VerifyEmail verifies the email address of a user
Click to show internal directories.
Click to hide internal directories.