services

package
v0.0.0-...-f57aad6 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Admin = "admin"
	User  = "user"
)

Variables

This section is empty.

Functions

func IsValid

func IsValid(roles []string) bool

func NewBootstrapService

func NewBootstrapService(us UserService) *bootstrapService

func NewUserService

func NewUserService(conn db.Connection) *userService

Types

type BootstrapService

type BootstrapService interface {
	InitUsers()
}

type Role

type Role string

func (Role) IsValid

func (r Role) IsValid() bool

type UserService

type UserService interface {
	FindAll() (*[]models.User, error)
	FindActive() (*[]models.User, error)
	Search(q string, pagination *models.Pagination) (*[]models.User, error)
	GetById(id string) (*models.User, error)
	GetByEmail(email string) (*models.User, error)
	Create(user models.User) (*models.User, error)
	EncryptPassword(password string) (string, error)
	VerifyPassword(hashed, password string) error
	IsEmpty() (bool, error)
}

Jump to

Keyboard shortcuts

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