service

package
v0.0.0-...-ebfcf3b Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionService

type SessionService interface {
	Create(device, name, password string) (*Tokens, error)
	Refresh(device string, token string) (*Tokens, error)
	VerifyAccess(token string) (string, error)
}

func NewSessionService

func NewSessionService(
	hasher hash.Hasher,
	userRepository repositories.UserRepository,
	sessionRepository repositories.SessionRepository,
	JWTConfig *config.JWTConfig,
) SessionService

type TaskService

type TaskService interface {
	Create(owner, name string, completed bool) error
	Read(id string) (*entities.Task, error)
	ReadAllByOwner(owner string) ([]*entities.Task, error)
	Update(id, name string, completed bool) (*entities.Task, error)
	Delete(id string) error
}

func NewTaskService

func NewTaskService(
	userRepository repositories.UserRepository,
	taskRepository repositories.TaskRepository,
) TaskService

type Tokens

type Tokens struct {
	Access          string
	Refresh         string
	AccessExpireAt  time.Time
	RefreshExpireAt time.Time
}

type UserService

type UserService interface {
	Create(name, password string) error
	Read(id string) (*entities.User, error)
	Update(id, name, password string) (*entities.User, error)
	Delete(id string) error
}

func NewUserService

func NewUserService(
	hasher hash.Hasher,
	userRepository repositories.UserRepository,
	taskRepository repositories.TaskRepository,
	sessionRepository repositories.SessionRepository,
) UserService

Jump to

Keyboard shortcuts

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