project

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	Load(ctx context.Context, id valueobject.Identifier) (*project.Aggregate, error)
	GetProjectIds(ctx context.Context, returnDeletedProjects bool) ([]valueobject.Identifier, error)
}

Reader interface

type Repository

type Repository interface {
	Reader
	Writer
}

Repository interface which should be implemented by repositories.

type Service

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

Service interface which contains the repository.

func NewService

func NewService(r Repository) *Service

NewService creates a new project use case.

func (*Service) CreateProject

func (s *Service) CreateProject(ctx context.Context, shortCode valueobject.ShortCode, shortName valueobject.ShortName, longName valueobject.LongName, description valueobject.Description) (valueobject.Identifier, error)

CreateProject creates new project with the provided values.

func (*Service) DeleteProject

func (s *Service) DeleteProject(ctx context.Context, uuid valueobject.Identifier) (*project.Aggregate, error)

DeleteProject deletes a project corresponding to the provided uuid.

func (*Service) GetProject

func (s *Service) GetProject(ctx context.Context, uuid valueobject.Identifier) (*project.Aggregate, error)

GetProject gets a project with the corresponding uuid.

func (*Service) ListProjects

func (s *Service) ListProjects(ctx context.Context, returnDeletedProjects bool) ([]project.Aggregate, error)

ListProjects lists all the active projects found in the event store. returnDeletedProjects can be used to also return projects that have been marked as deleted.

func (*Service) UpdateProject

func (s *Service) UpdateProject(ctx context.Context, id valueobject.Identifier, shortCode valueobject.ShortCode, shortName valueobject.ShortName, longName valueobject.LongName, description valueobject.Description) (*project.Aggregate, error)

UpdateProject updates the current project info with the provided values.

type UseCase

type UseCase interface {
	GetProject(ctx context.Context, id valueobject.Identifier) (*project.Aggregate, error)
	ListProjects(ctx context.Context, returnDeletedProjects bool) ([]project.Aggregate, error)
	CreateProject(ctx context.Context, shortCode valueobject.ShortCode, shortName valueobject.ShortName, longName valueobject.LongName, description valueobject.Description) (valueobject.Identifier, error)
	UpdateProject(ctx context.Context, id valueobject.Identifier, shortCode valueobject.ShortCode, shortName valueobject.ShortName, longName valueobject.LongName, description valueobject.Description) (*project.Aggregate, error)
	DeleteProject(ctx context.Context, id valueobject.Identifier) (*project.Aggregate, error)
}

UseCase interface which should be implemented by services.

type Writer

type Writer interface {
	Save(ctx context.Context, e *project.Aggregate) (valueobject.Identifier, error)
}

Writer interface

Jump to

Keyboard shortcuts

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