Documentation ¶
Index ¶
- func SetRoutes(engine *gin.Engine, datastore interfaces.Datastore, ...) error
- type Users
- func (u *Users) EmailVerification(c *gin.Context)
- func (u *Users) GetSession(c *gin.Context)
- func (u *Users) GetUsage(c *gin.Context)
- func (u *Users) GetUser(c *gin.Context)
- func (u *Users) ListTiers(c *gin.Context)
- func (u *Users) ListUserSessions(c *gin.Context)
- func (u *Users) LoginUser(c *gin.Context)
- func (u *Users) RefreshToken(c *gin.Context)
- func (u *Users) RegisterUser(c *gin.Context)
- func (u *Users) ResetPassword(c *gin.Context)
- func (u *Users) RevokeSession(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users contains the datastore and any HTTP handlers needed for application users
func New ¶
func New(db interfaces.Datastore, cache redis.UniversalClient, config *config.AppConfig) *Users
New returns a pointer to a new `Users`
func (*Users) EmailVerification ¶
EmailVerification looks up the verification code in redis and activates the associated user
func (*Users) GetSession ¶
GetSession retrieves the user's current session information.
func (*Users) ListUserSessions ¶
ListUserSessions returns a list of the user's active sessions
func (*Users) RefreshToken ¶
RefreshToken exchanges a valid refresh token for a new access token.
func (*Users) RegisterUser ¶
RegisterUser creates a new valid user in the database. The user will receive an access and refresh token on register. The user can then login next time.
func (*Users) ResetPassword ¶
ResetPassword authenticates the user using the old password, then sets a new password for the application user.
func (*Users) RevokeSession ¶
RevokeSession deletes a user's session.