adapter

package
v0.0.0-...-677ce44 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAdapter

type IAdapter interface {
	Count(ctx context.Context, query interface{}) (int64, error)
	Find(
		ctx context.Context,
		query interface{},
		docs interface{},
		opts ...interface{},
	) (err error)
	FindOne(
		ctx context.Context,
		query interface{},
		doc interface{},
		opts ...interface{},
	) (err error)
	Insert(
		ctx context.Context, doc interface{},
	) (insertedID interface{}, err error)
	InsertMany(
		ctx context.Context, docs []interface{},
	) (insertedIDs []interface{}, err error)
	Update(
		ctx context.Context, query interface{}, update interface{},
	) (res *UpdateSummary, err error)
	UpdateMany(
		ctx context.Context, query interface{}, update interface{},
	) (res *UpdateSummary, err error)
	Delete(ctx context.Context, filter interface{}) (delCount int64, err error)
	DeleteMany(ctx context.Context, filter interface{}) (delCount int64, err error)
}

IAdapter indicates the interface of the adapter.

type UpdateSummary

type UpdateSummary struct {
	MatchedCount  int64
	ModifiedCount int64
	UpsertedCount int64
	UpsertedIDs   interface{}
}

UpdateSummary represents a structure that tells the result of update/upsert.

Directories

Path Synopsis
db
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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