client

package
v0.0.0-...-f2d0a92 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Connect(context.Context) error
	Disconnect(context.Context) error

	Database(string) Database
	ListDatabaseNames(context.Context, interface{}) ([]string, error)
}

func WrapClient

func WrapClient(c *mongo.Client) Client

type Collection

type Collection interface {
	Aggregate(context.Context, interface{}, ...*options.AggregateOptions) (Cursor, error)
	Find(context.Context, interface{}, ...*options.FindOptions) (Cursor, error)
	FindOne(context.Context, interface{}, ...*options.FindOneOptions) SingleResult
	Name() string
	ReplaceOne(context.Context, interface{}, interface{}, ...*options.ReplaceOptions) (*UpdateResult, error)
	UpdateOne(context.Context, interface{}, interface{}, ...*options.UpdateOptions) (*UpdateResult, error)
	UpdateMany(context.Context, interface{}, interface{}, ...*options.UpdateOptions) (*UpdateResult, error)
	InsertOne(context.Context, interface{}) (*InsertOneResult, error)
	InsertMany(context.Context, []interface{}) (*InsertManyResult, error)
}

type Cursor

type Cursor interface {
	Current() []byte
	All(context.Context, interface{}) error
	Close(context.Context) error
	Decode(interface{}) error
	Err() error
	ID() int64
	Next(context.Context) bool
}

type Database

type Database interface {
	Client() Client
	Collection(string) Collection
	Name() string
	RunCommand(context.Context, interface{}) SingleResult
	RunCommandCursor(context.Context, interface{}) (Cursor, error)
}

type InsertManyResult

type InsertManyResult = mongo.InsertManyResult

type InsertOneResult

type InsertOneResult = mongo.InsertOneResult

type SingleResult

type SingleResult interface {
	Decode(interface{}) error
	Raw() ([]byte, error)
	Err() error
}

type UpdateResult

type UpdateResult = mongo.UpdateResult

Jump to

Keyboard shortcuts

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