Documentation
¶
Index ¶
- type Reader
- type Repository
- type Service
- func (s *Service) CreateProject(ctx context.Context, shortCode valueobject.ShortCode, ...) (valueobject.Identifier, error)
- func (s *Service) DeleteProject(ctx context.Context, uuid valueobject.Identifier) (*project.Aggregate, error)
- func (s *Service) GetProject(ctx context.Context, uuid valueobject.Identifier) (*project.Aggregate, error)
- func (s *Service) ListProjects(ctx context.Context, returnDeletedProjects bool) ([]project.Aggregate, error)
- func (s *Service) UpdateProject(ctx context.Context, id valueobject.Identifier, ...) (*project.Aggregate, error)
- type UseCase
- type Writer
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 ¶
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 (*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
Click to show internal directories.
Click to hide internal directories.