service

package
v0.0.0-...-ecdd535 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParamsCreateArticle

type ParamsCreateArticle struct {
	Title string `valid:"required"`
	URL   string `valid:"required"`
}

type ParamsUpdateArticle

type ParamsUpdateArticle struct {
	ID    int `valid:"required"`
	Title *string
	URL   *string
}

type Service

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

func NewService

func NewService(repo *repository.Repository) *Service

func (*Service) CreateArticle

func (s *Service) CreateArticle(ctx context.Context, params *ParamsCreateArticle) (int, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id int) error

func (*Service) GetArticle

func (s *Service) GetArticle(ctx context.Context, id int) (*domain.Article, error)

func (*Service) GetArticles

func (s *Service) GetArticles(ctx context.Context) (*domain.Articles, error)

func (*Service) UpdateArticle

func (s *Service) UpdateArticle(ctx context.Context, params *ParamsUpdateArticle) error

Jump to

Keyboard shortcuts

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