Documentation ¶
Index ¶
- func EvalQuery(q interface{}, src *Collection, result *map[int]struct{}) (err error)
- type Collection
- func (c *Collection) Delete(id int)
- func (c *Collection) ForEachDoc(fn func(id int, doc []byte) (moveOn bool))
- func (c *Collection) Index(cols []string) error
- func (c *Collection) Insert(doc map[string]interface{}) (int, error)
- func (c *Collection) Read(id int) (doc map[string]interface{}, err error)
- func (c *Collection) Update(id int, doc map[string]interface{}) error
- type DB
- type GenericModel
- type GenericRepository
- func (repo *GenericRepository) Delete(id int)
- func (repo *GenericRepository) Fetch(id int) GenericModel
- func (repo *GenericRepository) FetchAll() []GenericModel
- func (repo *GenericRepository) Index(cols []string)
- func (repo *GenericRepository) Query(query interface{}) []GenericModel
- func (repo *GenericRepository) Save(generic GenericModel)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalQuery ¶
func EvalQuery(q interface{}, src *Collection, result *map[int]struct{}) (err error)
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (*Collection) Delete ¶
func (c *Collection) Delete(id int)
func (*Collection) ForEachDoc ¶
func (c *Collection) ForEachDoc(fn func(id int, doc []byte) (moveOn bool))
func (*Collection) Index ¶
func (c *Collection) Index(cols []string) error
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func NewDatabaseConnection ¶
func (*DB) Use ¶
func (d *DB) Use(name string) *Collection
type GenericModel ¶
type GenericModel map[string]interface{}
type GenericRepository ¶
type GenericRepository struct {
// contains filtered or unexported fields
}
func NewGenericRepository ¶
func NewGenericRepository(database *DB, coll string) *GenericRepository
func (*GenericRepository) Delete ¶
func (repo *GenericRepository) Delete(id int)
func (*GenericRepository) Fetch ¶
func (repo *GenericRepository) Fetch(id int) GenericModel
func (*GenericRepository) FetchAll ¶
func (repo *GenericRepository) FetchAll() []GenericModel
func (*GenericRepository) Index ¶
func (repo *GenericRepository) Index(cols []string)
func (*GenericRepository) Query ¶
func (repo *GenericRepository) Query(query interface{}) []GenericModel
func (*GenericRepository) Save ¶
func (repo *GenericRepository) Save(generic GenericModel)
Click to show internal directories.
Click to hide internal directories.