Documentation ¶
Index ¶
- type Reader
- type Repository
- type Service
- func (s *Service) CreateAddress(ctx context.Context, street valueobject.Street, ...) (valueobject.Identifier, error)
- func (s *Service) DeleteAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error)
- func (s *Service) GetAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error)
- func (s *Service) GetAddresses(ctx context.Context, includeDeleted bool) ([]addressEntity.Address, error)
- func (s *Service) UpdateAddress(ctx context.Context, id valueobject.Identifier, street valueobject.Street, ...) (*addressEntity.Address, 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) (*addressEntity.Address, error) GetAddressIds(ctx context.Context, includeDeleted bool) ([]valueobject.Identifier, error) }
type Repository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
implements Repository interface
func (*Service) CreateAddress ¶
func (s *Service) CreateAddress(ctx context.Context, street valueobject.Street, postalCode valueobject.PostalCode, locality valueobject.Locality, country valueobject.Country, canton valueobject.Canton, additional valueobject.Additional) (valueobject.Identifier, error)
CreateAddress creates new address
func (*Service) DeleteAddress ¶
func (s *Service) DeleteAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error)
DeleteAddress deletes address of provided ID
func (*Service) GetAddress ¶
func (s *Service) GetAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error)
GetAddress gets address of provided ID
func (*Service) GetAddresses ¶
func (s *Service) GetAddresses(ctx context.Context, includeDeleted bool) ([]addressEntity.Address, error)
GetAddresses get existing addresses, setting includeDeleted returns also addresses marked as deleted
func (*Service) UpdateAddress ¶
func (s *Service) UpdateAddress(ctx context.Context, id valueobject.Identifier, street valueobject.Street, postalCode valueobject.PostalCode, locality valueobject.Locality, country valueobject.Country, canton valueobject.Canton, additional valueobject.Additional) (*addressEntity.Address, error)
UpdateAddress updates existing address with provided values
type UseCase ¶
type UseCase interface { GetAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error) GetAddresses(ctx context.Context, includeDeleted bool) ([]addressEntity.Address, error) CreateAddress(ctx context.Context, s valueobject.Street, pc valueobject.PostalCode, l valueobject.Locality, c valueobject.Country, ca valueobject.Canton, a valueobject.Additional) (valueobject.Identifier, error) UpdateAddress(ctx context.Context, id valueobject.Identifier, s valueobject.Street, pc valueobject.PostalCode, l valueobject.Locality, c valueobject.Country, ca valueobject.Canton, a valueobject.Additional) (*addressEntity.Address, error) DeleteAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error) }
type Writer ¶
type Writer interface {
Save(ctx context.Context, e *addressEntity.Address) (valueobject.Identifier, error)
}
Click to show internal directories.
Click to hide internal directories.