Documentation ¶
Index ¶
- Variables
- type DeleteFilter
- type Filter
- type NotFoundError
- type Relation
- type Repository
- type Service
- func (s *Service) BulkCreate(ctx context.Context, rels []Relation) error
- func (s *Service) BulkDelete(ctx context.Context, flt DeleteFilter) error
- func (s *Service) BulkSoftDelete(ctx context.Context, flt DeleteFilter) error
- func (s *Service) BulkUpsert(ctx context.Context, rels []Relation) error
- func (s *Service) List(ctx context.Context, flt Filter) ([]Relation, error)
- func (s *Service) Update(ctx context.Context, rel *Relation) error
- type Transactor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicate = errors.New("subscription id and receiver id already registered") ErrRelation = errors.New("subscription or receiver id does not exist") )
Functions ¶
This section is empty.
Types ¶
type DeleteFilter ¶
type NotFoundError ¶
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type Repository ¶
type Repository interface { List(context.Context, Filter) ([]Relation, error) BulkCreate(context.Context, []Relation) error BulkUpsert(context.Context, []Relation) error Update(context.Context, *Relation) error BulkSoftDelete(ctx context.Context, flt DeleteFilter) error BulkDelete(ctx context.Context, flt DeleteFilter) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func NewService ¶
func NewService( repository Repository, ) *Service
NewService returns service struct
func (*Service) BulkCreate ¶
func (*Service) BulkDelete ¶
func (s *Service) BulkDelete(ctx context.Context, flt DeleteFilter) error
func (*Service) BulkSoftDelete ¶
func (s *Service) BulkSoftDelete(ctx context.Context, flt DeleteFilter) error
func (*Service) BulkUpsert ¶
Click to show internal directories.
Click to hide internal directories.