Documentation ¶
Index ¶
- type DatabaseAccessor
- type DatabaseUpdateActions
- type HealthCheckInterface
- type MongoDatabase
- func (db MongoDatabase) Aggregate(table string, pipeline []map[string]interface{}) ([]map[string]interface{}, error)
- func (db MongoDatabase) Count(table string, filter map[string]interface{}) (int64, error)
- func (db MongoDatabase) CreateTextIndex(table string, keys []string) error
- func (db MongoDatabase) DeleteOne(table string, query map[string]interface{}) (bool, error)
- func (db MongoDatabase) Drop(table string) error
- func (db MongoDatabase) Find(table string, query map[string]interface{}) ([]interface{}, bool)
- func (db MongoDatabase) FindOne(table string, query map[string]interface{}) (interface{}, bool)
- func (db MongoDatabase) FindPaginated(table string, query map[string]interface{}, maxPages int64, lastID string) ([]map[string]interface{}, bool)
- func (db *MongoDatabase) Initialize(uri string, database string) error
- func (db MongoDatabase) InsertOne(table string, body map[string]interface{}) (interface{}, error)
- func (db MongoDatabase) MonitorConnection(heartbeat time.Duration, health HealthCheckInterface)
- func (db MongoDatabase) UpdateOne(table string, query map[string]interface{}, ...) (interface{}, error)
- type TestDatabase
- func (db TestDatabase) Aggregate(table string, pipeline []map[string]interface{}) ([]map[string]interface{}, error)
- func (db TestDatabase) CreateTextIndex(table string, keys []string) error
- func (db TestDatabase) DeleteOne(table string, query map[string]interface{}) (bool, error)
- func (db TestDatabase) Drop(table string) error
- func (db TestDatabase) Find(table string, query map[string]interface{}) ([]interface{}, bool)
- func (db TestDatabase) FindOne(table string, query map[string]interface{}) (interface{}, bool)
- func (db TestDatabase) FindPaginated(table string, query map[string]interface{}, maxPages int64, lastID string) ([]map[string]interface{}, bool)
- func (db TestDatabase) InsertOne(table string, body map[string]interface{}) (interface{}, error)
- func (db TestDatabase) MonitorConnection(heartbeat time.Duration, health HealthCheckInterface)
- func (db TestDatabase) UpdateOne(table string, query map[string]interface{}, ...) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseAccessor ¶
type DatabaseAccessor interface { InsertOne(table string, body map[string]interface{}) (interface{}, error) UpdateOne(table string, query map[string]interface{}, body map[DatabaseUpdateActions]map[string]interface{}) (interface{}, error) FindOne(table string, query map[string]interface{}) (interface{}, bool) Find(table string, query map[string]interface{}) ([]interface{}, bool) FindPaginated(table string, query map[string]interface{}, maxPages int64, lastID string) ([]map[string]interface{}, bool) DeleteOne(table string, query map[string]interface{}) (bool, error) CreateTextIndex(table string, keys []string) error Drop(table string) error Aggregate(table string, pipeline []map[string]interface{}) ([]map[string]interface{}, error) MonitorConnection(heartbeat time.Duration, health HealthCheckInterface) }
type DatabaseUpdateActions ¶
type DatabaseUpdateActions string
const ( SET DatabaseUpdateActions = "set" PUSH DatabaseUpdateActions = "push" )
type HealthCheckInterface ¶ added in v0.4.1
type HealthCheckInterface interface { SetMongoDown() SetMongoUp() IsMongoUp() bool }
type MongoDatabase ¶
type MongoDatabase struct { Ctx context.Context Cancel context.CancelFunc // contains filtered or unexported fields }
func (MongoDatabase) Aggregate ¶ added in v0.4.0
func (db MongoDatabase) Aggregate(table string, pipeline []map[string]interface{}) ([]map[string]interface{}, error)
func (MongoDatabase) Count ¶ added in v0.3.8
func (db MongoDatabase) Count(table string, filter map[string]interface{}) (int64, error)
func (MongoDatabase) CreateTextIndex ¶ added in v0.3.8
func (db MongoDatabase) CreateTextIndex(table string, keys []string) error
func (MongoDatabase) DeleteOne ¶
func (db MongoDatabase) DeleteOne(table string, query map[string]interface{}) (bool, error)
func (MongoDatabase) Drop ¶ added in v0.2.3
func (db MongoDatabase) Drop(table string) error
func (MongoDatabase) Find ¶
func (db MongoDatabase) Find(table string, query map[string]interface{}) ([]interface{}, bool)
func (MongoDatabase) FindOne ¶
func (db MongoDatabase) FindOne(table string, query map[string]interface{}) (interface{}, bool)
func (MongoDatabase) FindPaginated ¶ added in v0.3.8
func (*MongoDatabase) Initialize ¶
func (db *MongoDatabase) Initialize(uri string, database string) error
func (MongoDatabase) InsertOne ¶
func (db MongoDatabase) InsertOne(table string, body map[string]interface{}) (interface{}, error)
func (MongoDatabase) MonitorConnection ¶ added in v0.4.1
func (db MongoDatabase) MonitorConnection(heartbeat time.Duration, health HealthCheckInterface)
func (MongoDatabase) UpdateOne ¶
func (db MongoDatabase) UpdateOne(table string, query map[string]interface{}, body map[DatabaseUpdateActions]map[string]interface{}) (interface{}, error)
type TestDatabase ¶
func (TestDatabase) Aggregate ¶ added in v0.4.0
func (db TestDatabase) Aggregate(table string, pipeline []map[string]interface{}) ([]map[string]interface{}, error)
func (TestDatabase) CreateTextIndex ¶ added in v0.3.8
func (db TestDatabase) CreateTextIndex(table string, keys []string) error
func (TestDatabase) DeleteOne ¶
func (db TestDatabase) DeleteOne(table string, query map[string]interface{}) (bool, error)
func (TestDatabase) Drop ¶ added in v0.2.3
func (db TestDatabase) Drop(table string) error
func (TestDatabase) Find ¶
func (db TestDatabase) Find(table string, query map[string]interface{}) ([]interface{}, bool)
func (TestDatabase) FindOne ¶
func (db TestDatabase) FindOne(table string, query map[string]interface{}) (interface{}, bool)
func (TestDatabase) FindPaginated ¶ added in v0.3.8
func (TestDatabase) InsertOne ¶
func (db TestDatabase) InsertOne(table string, body map[string]interface{}) (interface{}, error)
func (TestDatabase) MonitorConnection ¶ added in v0.4.1
func (db TestDatabase) MonitorConnection(heartbeat time.Duration, health HealthCheckInterface)
func (TestDatabase) UpdateOne ¶
func (db TestDatabase) UpdateOne(table string, query map[string]interface{}, body map[DatabaseUpdateActions]map[string]interface{}) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.