service

package
v0.0.0-...-0c006ae Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 11 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
}

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

func (*AuthService) CreateUser

func (s *AuthService) CreateUser(user model.UserAccount) (uuid.UUID, error)

func (*AuthService) DeleteAccount

func (s *AuthService) DeleteAccount(userId uuid.UUID) error

func (*AuthService) GenerateToken

func (s *AuthService) GenerateToken(userAccount model.UserAccount) (uuid.UUID, string, error)

func (*AuthService) GetUser

func (s *AuthService) GetUser(userAccount model.UserAccount) (model.User, error)

func (*AuthService) ParseToken

func (s *AuthService) ParseToken(accessToken string) (uuid.UUID, error)

type Authorization

type Authorization interface {
	CreateUser(userAcc model.UserAccount) (uuid.UUID, error)
	GenerateToken(userAcc model.UserAccount) (uuid.UUID, string, error)
	GetUser(userAcc model.UserAccount) (model.User, error)
	ParseToken(bearerToken string) (uuid.UUID, error)
	DeleteAccount(userId uuid.UUID) error
}

type Category

type Category interface {
	Create(link model.Category) (uuid.UUID, error)
	GetAll(userId uuid.UUID) ([]model.Category, error)
	GetById(userId, categoryId uuid.UUID) (model.Category, error)
	DeleteById(userId, linkId uuid.UUID) error
	Update(category model.Category) error
}

type CategoryService

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

func NewCategoryService

func NewCategoryService(repo repository.Category) *CategoryService

func (CategoryService) Create

func (s CategoryService) Create(category model.Category) (uuid.UUID, error)

func (CategoryService) DeleteById

func (s CategoryService) DeleteById(userId, categoryId uuid.UUID) error

func (CategoryService) GetAll

func (s CategoryService) GetAll(userId uuid.UUID) ([]model.Category, error)

func (CategoryService) GetById

func (s CategoryService) GetById(userId, categoryId uuid.UUID) (model.Category, error)

func (CategoryService) Update

func (s CategoryService) Update(category model.Category) error
type Link interface {
	Create(link model.LinkUpdate) (uuid.UUID, error)
	GetAll(userId uuid.UUID) ([]model.Link, error)
	GetById(userId, linkId uuid.UUID) (model.Link, error)
	DeleteById(userId, linkId uuid.UUID) error
	Update(link model.LinkUpdate) error
}

type LinkService

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

func NewLinkService

func NewLinkService(repo repository.Link) *LinkService

func (LinkService) Create

func (s LinkService) Create(link model.LinkUpdate) (uuid.UUID, error)

func (LinkService) DeleteById

func (s LinkService) DeleteById(userId, linkId uuid.UUID) error

func (LinkService) GetAll

func (s LinkService) GetAll(userId uuid.UUID) ([]model.Link, error)

func (LinkService) GetById

func (s LinkService) GetById(userId, linkId uuid.UUID) (model.Link, error)

func (LinkService) Update

func (s LinkService) Update(link model.LinkUpdate) error

type Service

type Service struct {
	Authorization
	Link
	Category
	Statistic
}

func NewService

func NewService(repos *repository.Repository) *Service

type Statistic

type Statistic interface {
	Create(category model.Statistic) (uuid.UUID, error)
	GetAll(userId uuid.UUID) ([]model.Statistic, error)
}

type StatisticService

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

func NewStatisticService

func NewStatisticService(repo repository.Statistic) *StatisticService

func (StatisticService) Create

func (s StatisticService) Create(category model.Statistic) (uuid.UUID, error)

func (StatisticService) GetAll

func (s StatisticService) GetAll(userId uuid.UUID) ([]model.Statistic, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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