repository

package
v0.0.0-...-76f5359 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RecordNotFound = errors.New("record not found")
View Source
var TransitionNotApplicable = errors.New("cannot transition to the given status")

Functions

This section is empty.

Types

type CanCreateOrUpdate

type CanCreateOrUpdate interface {
	CreateOrUpdate(ctx context.Context, m model.Model, query interface{}, attrs ...interface{}) error
}

type CanFindByID

type CanFindByID interface {
	FindByID(ctx context.Context, m model.Model, id string, preloadFields ...string) error
	FindByIDWithPreloadCondition(ctx context.Context, m model.Model, id string, preloadFields ...PreloadField) error
}

type Creatable

type Creatable interface {
	Create(ctx context.Context, m model.Model) error
}

type PreloadField

type PreloadField struct {
	FieldName  string
	Conditions []interface{}
}

func NewPreloadField

func NewPreloadField(fieldName string, conditions ...interface{}) PreloadField

type Removable

type Removable interface {
	DeleteByID(ctx context.Context, m model.Model, id string) error
}

type Saveable

type Saveable interface {
	Save(ctx context.Context, m model.Model) error
}

type Searchable

type Searchable interface {
	Search(ctx context.Context, val interface{}, f filter.Filter, preloadFields ...string) error
	SearchWithPreloadCondition(ctx context.Context, val interface{}, f filter.Filter, preloadFields ...PreloadField) error
	SearchAndCount(ctx context.Context, val interface{}, f filter.Filter, preloadFields ...string) (int64, error)
}

type Updatable

type Updatable interface {
	Update(ctx context.Context, m model.Model, attrs ...interface{}) error
	Updates(ctx context.Context, m model.Model, params interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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