service

package
v0.0.0-...-e158c1e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 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 AddTask

type AddTask struct {
	DB   store.Execer
	Repo TaskAdder
}

func (*AddTask) AddTask

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

type ListTask

type ListTask struct {
	DB   store.Queryer
	Repo TaskLister
}

func (*ListTask) ListTasks

func (lt *ListTask) ListTasks(ctx context.Context) (entity.Tasks, error)

type Login

type Login struct {
	DB    store.Queryer
	Repo  UserGetter
	JWTer TokenGenerator
}

func (*Login) Login

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

type RegisterUser

type RegisterUser struct {
	DB   store.Execer
	Repo UserRegister
}

func (*RegisterUser) RegisterUser

func (ru *RegisterUser) 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