mongodb

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownFilter = errors.New("unknown filter")
)

Functions

This section is empty.

Types

type CollectionOperator added in v2.0.1

type CollectionOperator struct {
	// contains filtered or unexported fields
}

func NewCollectionOperator

func NewCollectionOperator(connection *Connection, database *clerk.Database) *CollectionOperator

func (*CollectionOperator) ExecuteDelete added in v2.0.1

func (d *CollectionOperator) ExecuteDelete(
	ctx context.Context,
	delete *clerk.Delete[*clerk.Collection],
) (int, error)

func (*CollectionOperator) ExecuteQuery added in v2.0.1

func (q *CollectionOperator) ExecuteQuery(
	ctx context.Context,
	query *clerk.Query[*clerk.Collection],
) (<-chan *clerk.Collection, error)

func (*CollectionOperator) ExecuteUpdate added in v2.0.1

func (u *CollectionOperator) ExecuteUpdate(
	ctx context.Context,
	update *clerk.Update[*clerk.Collection],
) error

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(
	ctx context.Context,
	uri string,
) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close(handler func(err error))

type DatabaseOperator added in v2.0.1

type DatabaseOperator struct {
	// contains filtered or unexported fields
}

func NewDatabaseOperator

func NewDatabaseOperator(connection *Connection) *DatabaseOperator

func (*DatabaseOperator) ExecuteDelete added in v2.0.2

func (d *DatabaseOperator) ExecuteDelete(
	ctx context.Context,
	delete *clerk.Delete[*clerk.Database],
) (int, error)

func (*DatabaseOperator) ExecuteQuery added in v2.0.1

func (q *DatabaseOperator) ExecuteQuery(
	ctx context.Context,
	query *clerk.Query[*clerk.Database],
) (<-chan *clerk.Database, error)

func (*DatabaseOperator) ExecuteTransaction added in v2.0.1

func (t *DatabaseOperator) ExecuteTransaction(ctx context.Context, fn clerk.TransactionFn) error

type IndexOperator added in v2.0.1

type IndexOperator struct {
	// contains filtered or unexported fields
}

func NewIndexOperator

func NewIndexOperator(connection *Connection, collection *clerk.Collection) *IndexOperator

func (*IndexOperator) ExecuteCreate added in v2.0.1

func (c *IndexOperator) ExecuteCreate(
	ctx context.Context,
	create *clerk.Create[*clerk.Index],
) error

func (*IndexOperator) ExecuteDelete added in v2.0.1

func (d *IndexOperator) ExecuteDelete(
	ctx context.Context,
	delete *clerk.Delete[*clerk.Index],
) (int, error)

func (*IndexOperator) ExecuteQuery added in v2.0.1

func (q *IndexOperator) ExecuteQuery(
	ctx context.Context,
	query *clerk.Query[*clerk.Index],
) (<-chan *clerk.Index, error)

type Operator added in v2.0.1

type Operator[T any] struct {
	// contains filtered or unexported fields
}

func NewOperator

func NewOperator[T any](connection *Connection, collection *clerk.Collection) *Operator[T]

func (*Operator) ExecuteCreate added in v2.0.1

func (c *Operator) ExecuteCreate(
	ctx context.Context,
	create *clerk.Create[T],
) error

func (*Operator) ExecuteDelete added in v2.0.1

func (d *Operator) ExecuteDelete(
	ctx context.Context,
	delete *clerk.Delete[T],
) (int, error)

func (*Operator) ExecuteQuery added in v2.0.1

func (q *Operator) ExecuteQuery(
	ctx context.Context,
	query *clerk.Query[T],
) (<-chan T, error)

func (*Operator) ExecuteUpdate added in v2.0.1

func (u *Operator) ExecuteUpdate(ctx context.Context, update *clerk.Update[T]) error

func (*Operator) ExecuteWatch added in v2.0.1

func (w *Operator) ExecuteWatch(
	ctx context.Context,
	watch *clerk.Watch[T],
) (<-chan *clerk.Event[T], error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL