service

package
v0.0.0-...-7253042 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTaskService

type AddTaskService struct {
	DB   store.Execer
	Repo TaskAdder
}

func (*AddTaskService) AddTask

func (a *AddTaskService) AddTask(ctx context.Context, title string) (*entity.Task, error)

type ListTaskService

type ListTaskService struct {
	DB   store.Queryer
	Repo TaskLister
}

func (*ListTaskService) ListTasks

func (l *ListTaskService) ListTasks(ctx context.Context) (entity.Tasks, error)

type LoginService

type LoginService struct {
	DB             store.Queryer
	Repo           UserGetter
	TokenGenerator TokenGenerator
}

func (*LoginService) Login

func (l *LoginService) Login(ctx context.Context, name, pw string) (string, error)

type RegisterUserService

type RegisterUserService struct {
	DB   store.Execer
	Repo UserRegister
}

func (*RegisterUserService) RegisterUser

func (r *RegisterUserService) RegisterUser(
	ctx context.Context, name, password, role string,
) (*entity.User, error)

type TaskAdder

type TaskAdder interface {
	AddTask(ctx context.Context, db store.Execer, t *entity.Task) error
}

type TaskLister

type TaskLister interface {
	ListTasks(ctx context.Context, db store.Queryer, id entity.UserID) (entity.Tasks, error)
}

type TokenGenerator

type TokenGenerator interface {
	GenerateToken(ctx context.Context, u entity.User) ([]byte, error)
}

type UserGetter

type UserGetter interface {
	GetUser(ctx context.Context, db store.Queryer, name string) (*entity.User, error)
}

type UserRegister

type UserRegister interface {
	RegisterUser(ctx context.Context, db store.Execer, u *entity.User) error
}

Jump to

Keyboard shortcuts

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