services

package
v0.0.0-...-e345738 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module exports services present

Functions

This section is empty.

Types

type JWTAuthService

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

JWTAuthService service relating to authorization

func NewJWTAuthService

func NewJWTAuthService(cfg *config.Config) *JWTAuthService

NewJWTAuthService creates a new auth service

func (*JWTAuthService) Authorize

func (s *JWTAuthService) Authorize(tokenString string) (bool, error)

Authorize authorizes the generated token

func (*JWTAuthService) CreateToken

func (s *JWTAuthService) CreateToken(user models.User) string

CreateToken creates jwt auth token

type UserService

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

UserService service layer

func NewUserService

func NewUserService(repository *repo.UserRepository) *UserService

NewUserService creates a new userservice

func (*UserService) CreateUser

func (s *UserService) CreateUser(user models.User) error

CreateUser call to create the user

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(id uint) error

DeleteUser deletes the user

func (*UserService) GetAllUser

func (s *UserService) GetAllUser() (users []models.User, err error)

GetAllUser get all the user

func (*UserService) GetOneUser

func (s *UserService) GetOneUser(id uint) (user models.User, err error)

GetOneUser gets one user

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(user models.User) error

UpdateUser updates the user

func (*UserService) WithTx

func (s *UserService) WithTx(txHandle *gorm.DB) *UserService

WithTx delegates transaction to repository database

Jump to

Keyboard shortcuts

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