users

package
v0.0.0-...-9841d36 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	FullName string `json:"full_name"`
}

func (*CreateRequest) ToUser

func (cr *CreateRequest) ToUser() (*domain.User, error)

func (*CreateRequest) Validate

func (cr *CreateRequest) Validate() error

type CreateResponse

type CreateResponse struct {
	ID string `json:"id"`
}

func NewCreateResponse

func NewCreateResponse(id string, _ *service.UserService) *CreateResponse

type FetchResponse

type FetchResponse struct {
	domain.User
}

func NewFetchResponse

func NewFetchResponse(d domain.User, _ *service.UserService) *FetchResponse

type Handler

type Handler struct{}

Handler is just a route collection

func (Handler) CreateUser

func (h Handler) CreateUser(logger *log.Logger, ds *service.UserService) func(c *routing.Context) error

func (Handler) GetUserByCredentials

func (h Handler) GetUserByCredentials(logger *log.Logger, ds *service.UserService) func(c *routing.Context) error

func (Handler) GetUserByID

func (h Handler) GetUserByID(logger *log.Logger, ds *service.UserService) func(c *routing.Context) error

func (Handler) Lock

func (h Handler) Lock(logger *log.Logger, ds *service.UserService) func(c *routing.Context) error

func (Handler) ResetPassword

func (h Handler) ResetPassword(logger *log.Logger, ds *service.UserService) func(c *routing.Context) error

func (Handler) Routes

func (h Handler) Routes(api *routing.RouteGroup, logger *log.Logger, s *service.UserService)

type LockRequest

type LockRequest struct {
	Reason string `json:"reason"`
}

func (*LockRequest) ToLock

func (r *LockRequest) ToLock() (*domain.Lock, error)

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Password string `json:"password"`
	Code     string `json:"code"`
}

func (*ResetPasswordRequest) Validate

func (cr *ResetPasswordRequest) Validate() error

type StatusResponse

type StatusResponse struct {
	Status string `json:"status"`
}

func NewStatusResponse

func NewStatusResponse(status string) *StatusResponse

Jump to

Keyboard shortcuts

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