users

package
v0.0.0-...-7238798 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserNotFound  = errors.New("user not found")
	ErrUserEdit   = errors.New("error user edit")
	ErrUserDelete = errors.New("erroru ser delete")
	ErrUserCreate = errors.New("error user create")
)

Functions

This section is empty.

Types

type User

type User struct {
	ID        UserID `db:"id"`
	Username  string `db:"username"`
	FirstName string `db:"first_name"`
	LastName  string `db:"last_name"`
	Email     string `db:"email"`
	Phone     string `db:"phone"`
}

User - model of user

type UserID

type UserID int64

UserID - surrogate key of the user table

func UserIDFromString

func UserIDFromString(s string) (UserID, error)

type UserService

type UserService interface {
	Get(UserID) (User, error)
	Create(User) (UserID, error)
	Edit(User) error
	Delete(UserID) error
}

UserService - service for work with users entities

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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