Documentation ¶
Index ¶
- type Mapper
- type Model
- func (self *Model) All(ctx context.Context, into interface{}) error
- func (self *Model) Average(ctx context.Context, field string, flt interface{}) (float64, error)
- func (self *Model) Count(ctx context.Context, flt interface{}) (uint64, error)
- func (self *Model) Create(ctx context.Context, from interface{}) error
- func (self *Model) CreateOrUpdate(ctx context.Context, id interface{}, from interface{}) error
- func (self *Model) Delete(ctx context.Context, ids ...interface{}) error
- func (self *Model) DeleteQuery(ctx context.Context, flt interface{}) error
- func (self *Model) Drop(ctx context.Context) error
- func (self *Model) Each(ctx context.Context, destZeroValue interface{}, resultFn ResultFunc) error
- func (self *Model) Exists(ctx context.Context, id interface{}) bool
- func (self *Model) Find(ctx context.Context, flt interface{}, into interface{}) error
- func (self *Model) FindFunc(ctx context.Context, flt interface{}, destZeroValue interface{}, ...) error
- func (self *Model) Get(ctx context.Context, id interface{}, into interface{}) error
- func (self *Model) GetBackend() backends.Backend
- func (self *Model) GetCollection() *dal.Collection
- func (self *Model) GroupBy(ctx context.Context, fields []string, aggregates []filter.Aggregate, ...) (*dal.RecordSet, error)
- func (self *Model) List(ctx context.Context, fields []string) (map[string][]interface{}, error)
- func (self *Model) ListWithFilter(ctx context.Context, fields []string, flt interface{}) (map[string][]interface{}, error)
- func (self *Model) Maximum(ctx context.Context, field string, flt interface{}) (float64, error)
- func (self *Model) Migrate(ctx context.Context) error
- func (self *Model) Minimum(ctx context.Context, field string, flt interface{}) (float64, error)
- func (self *Model) String() string
- func (self *Model) Sum(ctx context.Context, field string, flt interface{}) (float64, error)
- func (self *Model) Update(ctx context.Context, from interface{}) error
- type ResultFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { Mapper // contains filtered or unexported fields }
func (*Model) Create ¶
Creates and saves a new instance of the model from the given struct or dal.Record.
func (*Model) CreateOrUpdate ¶
Creates or updates an instance of the model depending on whether it exists or not.
func (*Model) DeleteQuery ¶
Delete all records matching the given query.
func (*Model) Each ¶
func (self *Model) Each(ctx context.Context, destZeroValue interface{}, resultFn ResultFunc) error
func (*Model) Find ¶
Perform a query for instances of the model that match the given filter.Filter. Results will be returned in the slice or array pointed to by the into parameter, or if into points to a dal.RecordSet, the RecordSet resulting from the query will be returned as-is.
func (*Model) FindFunc ¶
func (self *Model) FindFunc(ctx context.Context, flt interface{}, destZeroValue interface{}, resultFn ResultFunc) error
Perform a query for instances of the model that match the given filter.Filter. The given callback function will be called once per result.
func (*Model) Get ¶
Retrieves an instance of the model identified by the given ID and populates the value pointed to by the into parameter. Structs and dal.Record instances can be populated.
func (*Model) GetBackend ¶
func (*Model) GetCollection ¶
func (self *Model) GetCollection() *dal.Collection
func (*Model) ListWithFilter ¶
type ResultFunc ¶
type ResultFunc = backends.ResultFunc