Documentation
¶
Index ¶
- func UpdateNonNilFields(dst, src interface{}) error
- type BaseService
- func (s *BaseService[T, R]) Create(ctx context.Context, entity *T) error
- func (s *BaseService[T, R]) CreateFromDTO(ctx context.Context, dto R) (*T, error)
- func (s *BaseService[T, R]) Delete(ctx context.Context, id uint) error
- func (s *BaseService[T, R]) DeleteByConditions(ctx context.Context, conditions db_utils.ConditionsMap, preloads ...string) error
- func (s *BaseService[T, R]) GetByConditions(ctx context.Context, conditions db_utils.ConditionsMap, preloads ...string) (*T, error)
- func (s *BaseService[T, R]) GetByID(ctx context.Context, id uint) (*T, error)
- func (s *BaseService[T, R]) GetByIDWithPreloads(ctx context.Context, id uint, preloads ...string) (*T, error)
- func (s *BaseService[T, R]) List(ctx context.Context, opts *db_utils.QueryOptions) ([]*T, error)
- func (s *BaseService[T, R]) PatchUpdate(ctx context.Context, conditions db_utils.ConditionsMap, preloads []string, ...) (*T, error)
- func (s *BaseService[T, R]) Update(ctx context.Context, entity *T) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateNonNilFields ¶ added in v0.3.5
func UpdateNonNilFields(dst, src interface{}) error
Types ¶
type BaseService ¶
type BaseService[T entities.Entity, R request.Request[T]] struct { // contains filtered or unexported fields }
func NewBaseService ¶
func NewBaseService[T entities.Entity, R request.Request[T]](repo repositories.Repository[T]) *BaseService[T, R]
func (*BaseService[T, R]) Create ¶
func (s *BaseService[T, R]) Create(ctx context.Context, entity *T) error
func (*BaseService[T, R]) CreateFromDTO ¶
func (s *BaseService[T, R]) CreateFromDTO(ctx context.Context, dto R) (*T, error)
func (*BaseService[T, R]) Delete ¶
func (s *BaseService[T, R]) Delete(ctx context.Context, id uint) error
func (*BaseService[T, R]) DeleteByConditions ¶ added in v0.2.7
func (s *BaseService[T, R]) DeleteByConditions(ctx context.Context, conditions db_utils.ConditionsMap, preloads ...string) error
func (*BaseService[T, R]) GetByConditions ¶
func (s *BaseService[T, R]) GetByConditions(ctx context.Context, conditions db_utils.ConditionsMap, preloads ...string) (*T, error)
func (*BaseService[T, R]) GetByID ¶
func (s *BaseService[T, R]) GetByID(ctx context.Context, id uint) (*T, error)
func (*BaseService[T, R]) GetByIDWithPreloads ¶
func (*BaseService[T, R]) List ¶
func (s *BaseService[T, R]) List(ctx context.Context, opts *db_utils.QueryOptions) ([]*T, error)
func (*BaseService[T, R]) PatchUpdate ¶
func (s *BaseService[T, R]) PatchUpdate(ctx context.Context, conditions db_utils.ConditionsMap, preloads []string, dto interface{ ToEntity() (*T, error) }) (*T, error)
Click to show internal directories.
Click to hide internal directories.