users

package
v0.0.0-...-0d233d1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPasswordEmpty    = errors.New("password is required")
	ErrPasswordTooShort = errors.New("password must be at least 6 characters long")
	ErrNameEmpty        = errors.New("name is required")
	ErrLoginEmpty       = errors.New("login is required")
)

Functions

This section is empty.

Types

type User

type User struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	Login     string    `json:"login"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	LastLogin time.Time `json:"last_login"`
	Deleted   bool      `json:"-"`
}

func DecodeAndCreate

func DecodeAndCreate(body io.ReadCloser) (*User, error)

func DecodeAndUpdate

func DecodeAndUpdate(body io.ReadCloser, u *User) (*User, error)

func New

func New(id int64, name, login, password string) (*User, error)

func (*User) ChangeName

func (u *User) ChangeName(name string) error

func (*User) ChangePassword

func (u *User) ChangePassword(password string)

func (*User) GetID

func (u *User) GetID() int64

func (*User) GetLogin

func (u *User) GetLogin() string

func (*User) GetName

func (u *User) GetName() string

func (*User) GetPass

func (u *User) GetPass() string

func (*User) Validate

func (u *User) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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