model

package
v0.0.0-...-dec19c8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound             = errors.New("user not found")
	ErrAlreadyExists        = errors.New("user with this name already exists")
	ErrUIDAlreadyExists     = errors.New("user with this uid already exists")
	ErrIncorrectCredentials = errors.New("incorrect credentials")
)

Functions

This section is empty.

Types

type User

type User struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Password string `json:"password,omitempty"`
}

func NewUserFromRequest

func NewUserFromRequest(uid string, req *UserRequest) *User

type UserRequest

type UserRequest struct {
	Username string `json:"username" validate:"required,min=4,max=50"`
	Password string `json:"password" validate:"required,min=8,max=50"`
}

Jump to

Keyboard shortcuts

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