Documentation ¶
Index ¶
- Constants
- Variables
- type Service
- func (s *Service) BatchDelete(ctx context.Context, ids []string) error
- func (s *Service) BulkUpsert(ctx context.Context, resources []*domain.Resource) error
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) Find(ctx context.Context, filter domain.ListResourcesFilter) ([]*domain.Resource, error)
- func (s *Service) Get(ctx context.Context, ri *domain.ResourceIdentifier) (*domain.Resource, error)
- func (s *Service) GetOne(ctx context.Context, id string) (*domain.Resource, error)
- func (s *Service) Update(ctx context.Context, r *domain.Resource) error
- type ServiceDeps
Constants ¶
View Source
const ( AuditKeyResoruceBulkUpsert = "resource.bulkUpsert" AuditKeyResourceUpdate = "resource.update" AuditKeyResourceDelete = "resource.delete" AuditKeyResourceBatchDelete = "resource.batchDelete" )
Variables ¶
View Source
var ( // ErrEmptyIDParam is the error value if the resource id is empty ErrEmptyIDParam = errors.New("id can't be empty") // ErrRecordNotFound is the error value if the designated record id is not exists ErrRecordNotFound = errors.New("record not found") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles the business logic for resource
func (*Service) BatchDelete ¶
func (*Service) BulkUpsert ¶
BulkUpsert inserts or updates records
func (*Service) Find ¶
func (s *Service) Find(ctx context.Context, filter domain.ListResourcesFilter) ([]*domain.Resource, error)
Find records based on filters
type ServiceDeps ¶
Click to show internal directories.
Click to hide internal directories.