Documentation ¶
Index ¶
- type MongodbCollectionOperator
- func (o *MongodbCollectionOperator) Drop(ctx context.Context, collection *clerk.Collection) error
- func (o *MongodbCollectionOperator) List(ctx context.Context, database *clerk.Database) ([]*clerk.Collection, error)
- func (o *MongodbCollectionOperator) Rename(ctx context.Context, collection *clerk.Collection, renameTo string, drop bool) (*clerk.Collection, error)
- type MongodbConnection
- type MongodbOperator
- func (c *MongodbOperator[T]) Create(ctx context.Context, collection *clerk.Collection, data T) error
- func (c *MongodbOperator[T]) Delete(ctx context.Context, collection *clerk.Collection, filter map[string]any) error
- func (c *MongodbOperator[T]) Query(ctx context.Context, collection *clerk.Collection, filter map[string]any, ...) (<-chan T, error)
- func (c *MongodbOperator[T]) Update(ctx context.Context, collection *clerk.Collection, filter map[string]any, ...) error
- func (c *MongodbOperator[T]) Watch(ctx context.Context, collection *clerk.Collection, operation clerk.Operation) (<-chan T, error)
- type MongodbTransactionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongodbCollectionOperator ¶ added in v1.1.0
type MongodbCollectionOperator struct {
// contains filtered or unexported fields
}
func NewMongoCollectionOperator ¶ added in v1.1.0
func NewMongoCollectionOperator(connection *MongodbConnection) *MongodbCollectionOperator
func (*MongodbCollectionOperator) Drop ¶ added in v1.1.0
func (o *MongodbCollectionOperator) Drop( ctx context.Context, collection *clerk.Collection, ) error
func (*MongodbCollectionOperator) List ¶ added in v1.2.0
func (o *MongodbCollectionOperator) List( ctx context.Context, database *clerk.Database, ) ([]*clerk.Collection, error)
func (*MongodbCollectionOperator) Rename ¶ added in v1.1.0
func (o *MongodbCollectionOperator) Rename( ctx context.Context, collection *clerk.Collection, renameTo string, drop bool, ) (*clerk.Collection, error)
type MongodbConnection ¶
type MongodbConnection struct {
// contains filtered or unexported fields
}
func NewMongoConnection ¶
func NewMongoConnection(ctx context.Context, url string) (*MongodbConnection, error)
func (*MongodbConnection) Close ¶
func (c *MongodbConnection) Close(handler func(err error))
func (*MongodbConnection) WithTransaction ¶
func (c *MongodbConnection) WithTransaction(ctx context.Context, fn MongodbTransactionFunc) error
type MongodbOperator ¶
type MongodbOperator[T any] struct { // contains filtered or unexported fields }
func NewMongoOperator ¶
func NewMongoOperator[T any](connection *MongodbConnection) *MongodbOperator[T]
func (*MongodbOperator[T]) Create ¶
func (c *MongodbOperator[T]) Create( ctx context.Context, collection *clerk.Collection, data T, ) error
func (*MongodbOperator[T]) Delete ¶
func (c *MongodbOperator[T]) Delete( ctx context.Context, collection *clerk.Collection, filter map[string]any, ) error
func (*MongodbOperator[T]) Update ¶
func (c *MongodbOperator[T]) Update( ctx context.Context, collection *clerk.Collection, filter map[string]any, data T, upsert bool, ) error
func (*MongodbOperator[T]) Watch ¶
func (c *MongodbOperator[T]) Watch( ctx context.Context, collection *clerk.Collection, operation clerk.Operation, ) (<-chan T, error)
type MongodbTransactionFunc ¶
Click to show internal directories.
Click to hide internal directories.