Documentation ¶
Index ¶
- 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongodbConnection ¶ added in v0.2.4
type MongodbConnection struct {
// contains filtered or unexported fields
}
func NewMongoConnection ¶
func NewMongoConnection(ctx context.Context, url string) (*MongodbConnection, error)
func (*MongodbConnection) Close ¶ added in v0.2.4
func (c *MongodbConnection) Close(handler func(err error))
type MongodbOperator ¶ added in v0.3.0
type MongodbOperator[T any] struct { // contains filtered or unexported fields }
func NewMongoOperator ¶ added in v0.3.0
func NewMongoOperator[T any](connection *MongodbConnection) *MongodbOperator[T]
func (*MongodbOperator[T]) Create ¶ added in v0.3.0
func (c *MongodbOperator[T]) Create( ctx context.Context, collection *clerk.Collection, data T, ) error
func (*MongodbOperator[T]) Delete ¶ added in v0.3.0
func (c *MongodbOperator[T]) Delete( ctx context.Context, collection *clerk.Collection, filter map[string]any, ) error
func (*MongodbOperator[T]) Query ¶ added in v0.3.0
func (c *MongodbOperator[T]) Query( ctx context.Context, collection *clerk.Collection, filter map[string]any, skip int, take int, ) (<-chan T, error)
func (*MongodbOperator[T]) Update ¶ added in v0.3.0
func (c *MongodbOperator[T]) Update( ctx context.Context, collection *clerk.Collection, filter map[string]any, data T, upsert bool, ) error
func (*MongodbOperator[T]) Watch ¶ added in v0.3.0
func (c *MongodbOperator[T]) Watch( ctx context.Context, collection *clerk.Collection, operation clerk.Operation, ) (<-chan T, error)
Click to show internal directories.
Click to hide internal directories.