Documentation
¶
Index ¶
- Variables
- type DB
- func (db DB) CollectionPath(name string) string
- func (db *DB) CreateCollection(name string) error
- func (db *DB) DropCollection(name string) error
- func (db *DB) GetCollection(name string) (*collection, error)
- func (db *DB) HasCollection(name string) bool
- func (db *DB) InsertObjInto(collectionName string, o *Object) (objectID, error)
- func (db *DB) InsertObjIntoCollection(c *collection, o *Object) (objectID, error)
- func (db *DB) InsertObjectsInto(collectionName string, objects ...*Object) ([]objectID, error)
- func (db *DB) QueryCollection(name string) (*Query, error)
- func (db *DB) Stats() []string
- func (db *DB) StatsPrint(w io.Writer) error
- type Field
- func (f Field) Equal(value interface{}) condition
- func (f Field) Exists() condition
- func (f Field) Greater(value interface{}) condition
- func (f Field) GreaterOrEqual(value interface{}) condition
- func (f Field) In(values ...interface{}) condition
- func (f Field) LessThan(value interface{}) condition
- func (f Field) LessThanOrEqual(value interface{}) condition
- func (f Field) NotEqual(value interface{}) condition
- type Object
- func (o Object) Copy() *Object
- func (o Object) GetObjID() objectID
- func (o Object) GetValueForField(name string) interface{}
- func (o Object) HasField(name string) bool
- func (o Object) SetField(name string, value interface{}) error
- func (o Object) Unmarshal(v interface{}) error
- func (o Object) Write(w io.Writer) error
- type Objects
- type Query
- func (q *Query) Count() int
- func (q *Query) Delete() uint
- func (q *Query) DeleteById(id objectID) error
- func (q *Query) FindAll() Objects
- func (q *Query) GetObjbyID(id objectID) *Object
- func (q *Query) Matchcondition(p condition) *Query
- func (q *Query) Update(updateMap map[string]interface{}) error
- func (q *Query) Where(c condition) *Query
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCollectionAlreadyExists = errors.New("collection already exists") ErrCollectionDoesNotExist = errors.New("no such collection") )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (DB) CollectionPath ¶
func (*DB) CreateCollection ¶
func (*DB) DropCollection ¶
func (*DB) GetCollection ¶
func (*DB) HasCollection ¶
func (*DB) InsertObjInto ¶
func (*DB) InsertObjIntoCollection ¶
func (*DB) InsertObjectsInto ¶
type Field ¶
type Field struct {
Name string
}
func (Field) GreaterOrEqual ¶
func (f Field) GreaterOrEqual(value interface{}) condition
func (Field) LessThanOrEqual ¶
func (f Field) LessThanOrEqual(value interface{}) condition
type Object ¶
type Object map[string]interface{}
func NewObjectFromOne ¶
func NewObjectNil ¶
func NewObjectNil() *Object
func NewObjectWContent ¶
func NewObjectsFromMany ¶
func (Object) GetValueForField ¶
TODO: add error
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) DeleteById ¶
func (*Query) GetObjbyID ¶
func (*Query) Matchcondition ¶
Click to show internal directories.
Click to hide internal directories.