Documentation ¶
Index ¶
- type Database
- func (db *Database) AddIfNotExists(collectionName string, value interface{}) error
- func (db *Database) AddRecord(collectionName string, value interface{}) error
- func (db *Database) DumpCollection(collectionName string, output []interface{}) error
- func (db *Database) DumpCollectionToWriter(collectionName string, writer io.Writer) error
- func (db *Database) DumpDatabase(output []interface{}) error
- func (db *Database) DumpToWriter(writer io.Writer) error
- func (db *Database) FindAll(collectionName string, output []interface{}) error
- func (db *Database) FindAllByField(collectionName string, fieldName string, searchValue string, ...) error
- func (db *Database) GetTypeID() DatabaseTypeID
- func (db *Database) GetTypeName() string
- func (db *Database) Init() error
- func (db *Database) One(collectionName string, field string, value interface{}, output interface{}) error
- func (db *Database) RemoveCollection(collectionName string) error
- func (db *Database) RemoveRecord(collectionName string, value interface{}) error
- func (db *Database) UpdateRecord(collectionName string, value interface{}) error
- type DatabaseType
- type DatabaseTypeID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
Type DatabaseTypeID
}
func (*Database) AddIfNotExists ¶
func (*Database) DumpCollection ¶
func (*Database) DumpCollectionToWriter ¶
func (*Database) DumpDatabase ¶
func (*Database) FindAllByField ¶
func (*Database) GetTypeID ¶
func (db *Database) GetTypeID() DatabaseTypeID
func (*Database) GetTypeName ¶
func (*Database) RemoveCollection ¶
func (*Database) RemoveRecord ¶
func (*Database) UpdateRecord ¶
type DatabaseType ¶
type DatabaseType interface { GetTypeID() DatabaseTypeID GetTypeName() string Init() error AddRecord(string, interface{}) error // Add record to collection, return error if failed UpdateRecord(string, interface{}) error // Update record in collection if it exists, otherwise add it UpdateField(string, string, interface{}, interface{}) error // Update field in record if it exists, otherwise add it AddIfNotExists(string, interface{}) error // Add record to collection if it doesn't exist RemoveRecord(string, interface{}) error // Remove a specific record from the given collection RemoveCollection(string) error // Remove the given collection and all its records // One single search result // Collection, Field, Value, Output One(string, string, interface{}, interface{}) error // FindAll records in collection that match the interface. FindAll(string, []interface{}) error // FindAllByField finds all interfaces by - collection, field, search value FindAllByField(string, string, string, []interface{}) error // DumpDatabase dumps the entire database as []interface{} DumpDatabase([]interface{}) error // DumpCollection dumps the entire collection as []interface{} DumpCollection(string, []interface{}) error // DumpToWriter dumps the entire database to the writer DumpToWriter(io.Writer) error // DumpCollectionToWriter dumps the entire collection to the writer DumpCollectionToWriter(string, io.Writer) error }
type DatabaseTypeID ¶
type DatabaseTypeID int
const ( DatabaseTypeID_Unknown DatabaseTypeID = iota DatabaseTypeID_BoltDB DatabaseTypeID_MongoDB )
func (*DatabaseTypeID) String ¶
func (dt *DatabaseTypeID) String() string
Click to show internal directories.
Click to hide internal directories.