users

package
v0.0.0-...-7d38a10 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(verify verify, createToken createToken, storeTokenDetails storeTokenDetails) *api.Endpoint

func Logout

func Logout(validateToken validateToken, deleteTokenDetails deleteTokenDetails) *api.Endpoint

func Register

func Register(existsByUsername existsByUsername, existsByEmail existsByEmail, insertUser insertUser) *api.Endpoint

Types

type RegisterRequest

type RegisterRequest struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

func (*RegisterRequest) Validate

func (u *RegisterRequest) Validate(usernameExists, emailExists bool) map[string]string

type RegisterResponse

type RegisterResponse struct {
	Errors map[string]string `json:"errors,omitempty"`
}

type UserLoginRequest

type UserLoginRequest struct {
	Login    string `json:"login"`
	Password string `json:"password"`
}

type UserLoginResponse

type UserLoginResponse struct {
	AccessToken  string            `json:"access_token,omitempty"`
	RefreshToken string            `json:"refresh_token,omitempty"`
	Errors       map[string]string `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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