article

package
v0.0.0-...-789fa8c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 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 CreationData

type CreationData struct {
	Title       string
	Description string
	Body        string
	TagList     []string
	Author      userDomain.User
}

type MutationData

type MutationData struct {
	Title       *string
	Description *string
	Body        *string
}

type Service

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

func NewArticleService

func NewArticleService(articleRepo port.ArticleRepository, tagService port.CreateTagService) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, data CreationData) (*domain.Article, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, slug string) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, slug string) (*domain.Article, error)

func (*Service) GetAll

func (s *Service) GetAll(ctx context.Context, criteria domain.ArticleCriteria) ([]*domain.Article, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, slug string, data MutationData) (*domain.Article, error)

type TagService

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

func NewTagService

func NewTagService(repo port.TagRepository) *TagService

func (*TagService) Create

func (s *TagService) Create(ctx context.Context, tag domain.Tag) error

func (*TagService) FindAll

func (s *TagService) FindAll(ctx context.Context) ([]domain.Tag, error)

type TagUseCase

type TagUseCase interface {
	Create(ctx context.Context, tag domain.Tag) error
	FindAll(ctx context.Context) ([]domain.Tag, error)
}

type UseCase

type UseCase interface {
	Create(ctx context.Context, data CreationData) (*domain.Article, error)
	Get(ctx context.Context, slug string) (*domain.Article, error)
	GetAll(ctx context.Context, criteria domain.ArticleCriteria) ([]*domain.Article, error)
	Update(ctx context.Context, slug string, data MutationData) (*domain.Article, error)
	Delete(ctx context.Context, slug string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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