Documentation ¶
Index ¶
- type Mapper
- type Model
- func (self *Model) All(into interface{}) error
- func (self *Model) Average(field string, flt interface{}) (float64, error)
- func (self *Model) Count(flt interface{}) (uint64, error)
- func (self *Model) Create(from interface{}) error
- func (self *Model) CreateOrUpdate(id interface{}, from interface{}) error
- func (self *Model) Delete(ids ...interface{}) error
- func (self *Model) DeleteQuery(flt interface{}) error
- func (self *Model) Drop() error
- func (self *Model) Each(destZeroValue interface{}, resultFn ResultFunc) error
- func (self *Model) Exists(id interface{}) bool
- func (self *Model) Find(flt interface{}, into interface{}) error
- func (self *Model) FindFunc(flt interface{}, destZeroValue interface{}, resultFn ResultFunc) error
- func (self *Model) Get(id interface{}, into interface{}) error
- func (self *Model) GetBackend() backends.Backend
- func (self *Model) GetCollection() *dal.Collection
- func (self *Model) GroupBy(fields []string, aggregates []filter.Aggregate, flt interface{}) (*dal.RecordSet, error)
- func (self *Model) List(fields []string) (map[string][]interface{}, error)
- func (self *Model) ListWithFilter(fields []string, flt interface{}) (map[string][]interface{}, error)
- func (self *Model) Maximum(field string, flt interface{}) (float64, error)
- func (self *Model) Migrate() error
- func (self *Model) Minimum(field string, flt interface{}) (float64, error)
- func (self *Model) String() string
- func (self *Model) Sum(field string, flt interface{}) (float64, error)
- func (self *Model) Update(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(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(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