service

package
v0.0.0-...-a67f385 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

AuthService - service

func NewAuthService

func NewAuthService(repo repository.Authorizer) *AuthService

NewAuthService - constructor

func (*AuthService) GetAccount

func (s *AuthService) GetAccount(token string) (models.Account, error)

func (*AuthService) GetAccountById

func (s *AuthService) GetAccountById(publicId uuid.UUID) (models.Account, error)

func (*AuthService) ParseToken

func (s *AuthService) ParseToken(accessToken string) (int, error)

type Authorizer

type Authorizer interface {
	ParseToken(token string) (int, error)
	GetAccount(token string) (models.Account, error)
	GetAccountById(publicId uuid.UUID) (models.Account, error)
}

type Service

type Service struct {
	Authorizer
	Tasker
}

Service - just service

func NewService

func NewService(repos *repository.Repository) *Service

NewService - constructor

type TaskService

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

TaskService - service

func NewTaskService

func NewTaskService(repo repository.Tasker) *TaskService

NewTaskService - constructor

func (*TaskService) CreateTask

func (s *TaskService) CreateTask(task models.Task) (int, error)

func (*TaskService) GetAllTasksByAssignedAccountId

func (s *TaskService) GetAllTasksByAssignedAccountId(assignedAccountId int) ([]models.Task, error)

func (*TaskService) GetTaskById

func (s *TaskService) GetTaskById(taskId int) (models.Task, error)

type Tasker

type Tasker interface {
	CreateTask(task models.Task) (int, error)
	GetTaskById(taskId int) (models.Task, error)
	GetAllTasksByAssignedAccountId(assignedAccountId int) ([]models.Task, error)
}

Jump to

Keyboard shortcuts

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