Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateUser(ctx context.Context, q *data.Queries, plaintext string) (*api.UserResponse, error)
- func DeleteMessage(ctx context.Context, q *data.Queries, mid, uid int64) (*api.AcceptanceResponse, error)
- func GetMessage(ctx context.Context, q *data.Queries, mid, uid int64) (*api.MessageResponse, error)
- func GetUserMessages(ctx context.Context, q *data.Queries, page, pageSize int32, userID int64) (*api.MessagesResponse, error)
- func NewAccessToken(ctx context.Context, q *data.Queries, tokenFromCookie string) (refresh, access *api.TokenResponse, err error)
- func NewActivationToken(ctx context.Context, q *data.Queries, email string) (*api.TokenResponse, error)
- func NewMessage(ctx context.Context, q *data.Queries, m string, userID int64) (*api.MessageResponse, error)
- func NewPasswordResetToken(ctx context.Context, q *data.Queries, email string) (*api.TokenResponse, error)
- func NewRefreshToken(ctx context.Context, q *data.Queries, email, pass string) (refresh, access *api.TokenResponse, err error)
- func NewUser(ctx context.Context, q *data.Queries, name, email, pass string) (*api.UserResponse, *api.TokenResponse, error)
- func UpdateMessage(ctx context.Context, q *data.Queries, m string, mid, uid int64) (*api.MessageResponse, error)
- func UpdateUserPassword(ctx context.Context, q *data.Queries, token, pass string) (*api.AcceptanceResponse, error)
Constants ¶
View Source
const ( PasswordCost = 13 ScopeAccess = "access" ScopeActivation = "activation" ScopePasswordReset = "password-reset" ScopeRefresh = "refresh" )
Variables ¶
View Source
var ( ErrActivationRequired = errors.New("user account must be activated") ErrEditConflict = errors.New("unable to update the record due to an edit conflict") ErrEmailNotFound = errors.New("no matching email address found") ErrInvalidAccessToken = errors.New("invalid access token") ErrInvalidCredentials = errors.New("invalid authentication credentials") ErrInvalidToken = errors.New("invalid or missing token") ErrMessageNotFound = errors.New("no matching message found") ErrReusedRefreshToken = errors.New("reused refresh token") ErrServerError = errors.New("the server encountered a problem and could not process your request") ErrUserAlreadyActivated = errors.New("user has already been activated") ErrUserExists = errors.New("a user with this email address already exists") )
Functions ¶
func ActivateUser ¶
func DeleteMessage ¶
func GetMessage ¶
func GetUserMessages ¶
func NewAccessToken ¶
func NewActivationToken ¶
func NewMessage ¶
func NewPasswordResetToken ¶
func NewRefreshToken ¶
func NewUser ¶
func NewUser(ctx context.Context, q *data.Queries, name, email, pass string) (*api.UserResponse, *api.TokenResponse, error)
func UpdateMessage ¶
func UpdateUserPassword ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.