9fd39a0681
* WIP on mongodb plugin * Add mongodb plugin * Add tests * Update mongodb.CreateUser() comment * Update docs * Add missing docs * Fix mongodb docs * Minor comment and test updates * Fix imports * Fix dockertest import * Set c.Initialized at the end, check for empty CreationStmts first on CreateUser * Remove Initialized check on Connection() * Add back Initialized check * Update docs * Move connProducer and credsProducer into pkg for mongodb and cassandra * Chage parseMongoURL to be a private func * Default to admin if no db is provided in creation_statements * Update comments and docs
22 lines
487 B
Go
22 lines
487 B
Go
package connutil
|
|
|
|
import (
|
|
"errors"
|
|
"sync"
|
|
)
|
|
|
|
var (
|
|
ErrNotInitialized = errors.New("connection has not been initalized")
|
|
)
|
|
|
|
// ConnectionProducer can be used as an embeded interface in the Database
|
|
// definition. It implements the methods dealing with individual database
|
|
// connections and is used in all the builtin database types.
|
|
type ConnectionProducer interface {
|
|
Close() error
|
|
Initialize(map[string]interface{}, bool) error
|
|
Connection() (interface{}, error)
|
|
|
|
sync.Locker
|
|
}
|