services

package
v0.0.0-...-eddbae0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigService

type ConfigService struct {
	AppName string `toml:"app_name"`
	Version string
	PG      pgConfig
	HTTP    httpEndpointConfig `toml:"http"`
	Auth    authConfig
}

func (*ConfigService) Load

func (c *ConfigService) Load(file string) error

type PGService

type PGService struct {
	DB *pg.DB
}

func (*PGService) Connect

func (s *PGService) Connect(address string, user string, password string, database string, poolSize int) (err error)

func (*PGService) Kill

func (s *PGService) Kill()

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(pgdb *pg.DB) *UserService

func (*UserService) ComparePassword

func (u *UserService) ComparePassword(email string, password string) (*models.User, error)

func (*UserService) Count

func (u *UserService) Count(role int) (int, error)

func (*UserService) Create

func (u *UserService) Create(user *models.User) (*models.User, error)

func (*UserService) Delete

func (u *UserService) Delete(email string) error

Performs soft delete

func (*UserService) Find

func (u *UserService) Find(ID int32) (*models.User, error)

Find user by ID

func (*UserService) FindByEmail

func (u *UserService) FindByEmail(email string) (*models.User, error)

FindByEmail finds user by email

func (*UserService) List

func (u *UserService) List(limit int, offset int, userRole int) ([]*models.User, error)

func (*UserService) UpdateLogin

func (u *UserService) UpdateLogin(user *models.User, ipText string) error

Jump to

Keyboard shortcuts

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