service

package
v0.0.0-...-57d8560 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserAlreadyExist = errors.New("User already exist")
)

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

Types

type Claims

type Claims struct {
	Email string `json:"email"`
	jwt.RegisteredClaims
}

type Service

type Service struct {
	DB *gorm.DB
}

func (*Service) CreateJobs

func (s *Service) CreateJobs(db *gorm.DB, jobs []*model.Job) ([]*model.Job, error)

func (*Service) CreateJobsAndCompanies

func (s *Service) CreateJobsAndCompanies(jobs []*model.Job, companies map[string]*model.Company) error

func (*Service) CreateUser

func (s *Service) CreateUser(email string, password string) (token string, err error)

func (*Service) GetCompanies

func (s *Service) GetCompanies(paginationInput graphmodel.PaginationInput) ([]*model.Company, *pagination.PaginationResult, error)

func (*Service) GetJobs

func (s *Service) GetJobs(paginationInput graphmodel.PaginationInput) ([]*model.Job, *pagination.PaginationResult, error)

type Servicer

type Servicer interface {
	GetJobs(pagination graphmodel.PaginationInput) ([]*model.Job, *pagination.PaginationResult, error)
	GetCompanies(pagination graphmodel.PaginationInput) ([]*model.Company, *pagination.PaginationResult, error)
	CreateUser(email string, password string) (token string, err error)
}

Jump to

Keyboard shortcuts

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