users

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Token    string
	PersonID int32
	Role     types.UserRole
}

type Claims

type Claims struct {
	Email    string
	PersonID int32
	Role     types.UserRole
	jwt.StandardClaims
}

type Domain

type Domain struct {
	ID        int
	PersonID  int
	Email     string
	Password  string
	Role      types.UserRole
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewUser

func NewUser(personID int, email string, password string, role types.UserRole) Domain

func (*Domain) ModifyUser

func (old *Domain) ModifyUser(email string, password string, role types.UserRole) Domain

type Repositories

type Repositories interface {
	InsertUser(domain Domain) (id int, err error)
	LoginUser(email string) (user *Domain, err error)
	FindUserByPersonID(personID int) (user *Domain, err error)
	UpdateUserByID(domain Domain) (err error)
	DeleteUserByID(id int) (err error)
}

type Services

type Services interface {
	LoginUser(loginUser *spec.UpsertUserLoginSpec) (auth *Auth, err error)
}

func NewService

func NewService(userRepo Repositories, config *config.AppConfig) Services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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