Documentation ¶
Index ¶
- Variables
- func Each(i Iterator, fn func(interface{}) error) error
- func EachChannel(i Iterator) chan interface{}
- func NewBackendContext(ctx context.Context, b Backend) context.Context
- type Backend
- type IdentityMap
- type Iterator
- type MongoDBBackend
- func (m *MongoDBBackend) Close() error
- func (m *MongoDBBackend) Find(objectType string, query map[string]interface{}) (Iterator, error)
- func (m *MongoDBBackend) FindID(objectType string, id interface{}) (interface{}, error)
- func (m *MongoDBBackend) Upsert(objectType string, query map[string]interface{}, object interface{}) error
- func (m *MongoDBBackend) UpsertID(objectType string, id, object interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBackendNotInitializedError = errors.New("backend not initialized") ErrBackendType = errors.New("object type is incorrect") )
Functions ¶
func EachChannel ¶ added in v0.3.4
func EachChannel(i Iterator) chan interface{}
Types ¶
type Backend ¶
type Backend interface { Find(objectType string, query map[string]interface{}) (Iterator, error) FindID(objectType string, id interface{}) (interface{}, error) Upsert(objectType string, query map[string]interface{}, object interface{}) error UpsertID(objectType string, id, object interface{}) error Close() error }
type IdentityMap ¶ added in v0.3.4
type IdentityMap struct { Backend // contains filtered or unexported fields }
func NewIdentityMap ¶ added in v0.3.4
func NewIdentityMap(b Backend) *IdentityMap
func (*IdentityMap) FindID ¶ added in v0.3.4
func (m *IdentityMap) FindID(objectType string, id interface{}) (interface{}, error)
type MongoDBBackend ¶ added in v0.3.4
type MongoDBBackend struct {
// contains filtered or unexported fields
}
MongoDBBackend represents a MongoDB backend.
func NewMongoDBBackend ¶ added in v0.3.4
func NewMongoDBBackend(addrs []string, database, username, password string, ssl bool) (*MongoDBBackend, error)
NewMongoDBBackend creates a new MongoDBBackendBackend object using a MongoDB conection string. Any database defined in the connection string will be overridden by the argument-specified database.
func (*MongoDBBackend) Close ¶ added in v0.3.4
func (m *MongoDBBackend) Close() error
Close closes the underlying session.
func (*MongoDBBackend) Find ¶ added in v0.3.4
func (m *MongoDBBackend) Find(objectType string, query map[string]interface{}) (Iterator, error)
func (*MongoDBBackend) FindID ¶ added in v0.3.4
func (m *MongoDBBackend) FindID(objectType string, id interface{}) (interface{}, error)
func (*MongoDBBackend) Upsert ¶ added in v0.3.4
func (m *MongoDBBackend) Upsert(objectType string, query map[string]interface{}, object interface{}) error
func (*MongoDBBackend) UpsertID ¶ added in v0.3.4
func (m *MongoDBBackend) UpsertID(objectType string, id, object interface{}) error
Click to show internal directories.
Click to hide internal directories.