services

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

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 (s *BaseService[T, R]) GetByIDWithPreloads(ctx context.Context, id uint, preloads ...string) (*T, error)

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)

func (*BaseService[T, R]) Update

func (s *BaseService[T, R]) Update(ctx context.Context, entity *T) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL