users

package
v0.0.0-...-cbce884 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRoutes

func SetRoutes(engine *gin.Engine, datastore interfaces.Datastore, cache redis.UniversalClient, config *config.AppConfig) error

SetRoutes sets all of the appropriate routes to handlers for users

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

New returns a pointer to a new `Users`

func (*Users) EmailVerification

func (u *Users) EmailVerification(c *gin.Context)

EmailVerification looks up the verification code in redis and activates the associated user

func (*Users) GetSession

func (u *Users) GetSession(c *gin.Context)

GetSession retrieves the user's current session information.

func (*Users) GetUsage

func (u *Users) GetUsage(c *gin.Context)

GetUsage returns the current usage for the account/user

func (*Users) GetUser

func (u *Users) GetUser(c *gin.Context)

GetUser retrieves the user by ID

func (*Users) ListTiers

func (u *Users) ListTiers(c *gin.Context)

ListTiers retrieves the list available tiers for this account/user

func (*Users) ListUserSessions

func (u *Users) ListUserSessions(c *gin.Context)

ListUserSessions returns a list of the user's active sessions

func (*Users) LoginUser

func (u *Users) LoginUser(c *gin.Context)

LoginUser creates a session for an existing management application user.

func (*Users) RefreshToken

func (u *Users) RefreshToken(c *gin.Context)

RefreshToken exchanges a valid refresh token for a new access token.

func (*Users) RegisterUser

func (u *Users) RegisterUser(c *gin.Context)

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

func (u *Users) ResetPassword(c *gin.Context)

ResetPassword authenticates the user using the old password, then sets a new password for the application user.

func (*Users) RevokeSession

func (u *Users) RevokeSession(c *gin.Context)

RevokeSession deletes a user's session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL