mongox

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingResumeToken  = mongo.ErrMissingResumeToken
	ErrNilCursor           = mongo.ErrNilCursor
	ErrUnacknowledgedWrite = mongo.ErrUnacknowledgedWrite
	ErrClientDisconnected  = mongo.ErrClientDisconnected
	ErrNilDocument         = mongo.ErrNilDocument
	ErrEmptySlice          = mongo.ErrEmptySlice
	ErrInvalidIndexValue   = mongo.ErrInvalidIndexValue
	ErrNonStringIndexName  = mongo.ErrNonStringIndexName
	ErrMultipleIndexDrop   = mongo.ErrMultipleIndexDrop
	ErrWrongClient         = mongo.ErrWrongClient
	ErrNoDocuments         = mongo.ErrNoDocuments
)

Reexported mongo errors

Functions

This section is empty.

Types

type Client

type Client = mongo.Client

Reexport basic mongo structs

type Collection

type Collection = mongo.Collection

Reexport basic mongo structs

type Cursor

type Cursor = mongo.Cursor

Reexport basic mongo structs

type Database

type Database interface {
	Client() *Client
	Context() context.Context
	Name() string
	New(ctx context.Context) Database
	GetCollectionOf(document interface{}) *Collection
	Count(target interface{}, filters ...interface{}) (int64, error)
	DeleteArray(target interface{}) error
	DeleteOne(target interface{}, filters ...interface{}) error
	LoadArray(target interface{}, filters ...interface{}) error
	LoadOne(target interface{}, filters ...interface{}) error
	LoadStream(target interface{}, filters ...interface{}) (StreamLoader, error)
	SaveOne(source interface{}) error
	IndexEnsure(cfg interface{}, document interface{}) error
}

Database is the mongox database interface

type InterfaceBased

type InterfaceBased interface {
	GetID() interface{}
	SetID(id interface{})
}

InterfaceBased is an interface for documents that have custom declated type for the _id field

type JSONBased

type JSONBased interface {
	GetID() primitive.D
	SetID(id primitive.D)
}

JSONBased is an interface for documents that have object type for the _id field

type OIDBased

type OIDBased interface {
	GetID() primitive.ObjectID
	SetID(id primitive.ObjectID)
}

OIDBased is an interface for documents that have objectId type for the _id field

type StreamLoader

type StreamLoader interface {
	Cursor() *Cursor
	DecodeNext() error
	Decode() error
	Next() error
	Close() error
	Err() error
}

StreamLoader is a interface to control database cursor

type StringBased

type StringBased interface {
	GetID() string
	SetID(id string)
}

StringBased is an interface for documents that have string type for the _id field

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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