db

package
v0.1.984 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	contract.DBOperator
}

func NewClient

func NewClient(d Dependencies, opts ClientOptions) (Client, error)

type ClientOption added in v0.1.14

type ClientOption = contract.Opt[ClientOptions]

func WithTimeout added in v0.1.14

func WithTimeout(x time.Duration) ClientOption

type ClientOptions added in v0.1.14

type ClientOptions struct {
	Timeout time.Duration
}

func ApplyClientOptions added in v0.1.14

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool added in v0.1.11

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) DeleteMany added in v0.1.11

func (d *DefaultTool) DeleteMany(ctx context.Context, opts contract.DeleteManyOptions) error

DeleteMany removes multiple documents that match the given filter.

func (*DefaultTool) DeleteOne added in v0.1.11

func (d *DefaultTool) DeleteOne(ctx context.Context, opts contract.DeleteOneOptions) error

DeleteOne removes a single document that matches the provided filter.

func (*DefaultTool) FindMany added in v0.1.11

func (d *DefaultTool) FindMany(ctx context.Context, opts contract.FindManyOptions) ([]any, error)

FindMany retrieves multiple documents that match the filter criteria.

func (*DefaultTool) FindOne added in v0.1.11

func (d *DefaultTool) FindOne(ctx context.Context, opts contract.FindOneOptions) error

FindOne retrieves a single document from the collection based on the provided filter.

func (*DefaultTool) InsertOne added in v0.1.11

func (d *DefaultTool) InsertOne(ctx context.Context, opts contract.InsertOneOptions) error

InsertOne inserts a single document into the specified collection.

func (*DefaultTool) ReplaceOne added in v0.1.11

func (d *DefaultTool) ReplaceOne(ctx context.Context, opts contract.ReplaceOneOptions) error

ReplaceOne updates a document that matches the filter with the provided document.

type Dependencies added in v0.1.8

type Dependencies struct {
	C contract.DBOperator
}

type Tool added in v0.1.245

type Tool interface {
	Client
}

Jump to

Keyboard shortcuts

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