mongodb

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

func (*Iterator) Cursor

func (it *Iterator) Cursor() (string, error)

func (*Iterator) Next

func (it *Iterator) Next(dst interface{}) error

type MongoDB

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

func NewMongoDB

func NewMongoDB(ctx context.Context, url, database string, opts ...Option) (*MongoDB, error)

func (*MongoDB) Close

func (m *MongoDB) Close() error

func (*MongoDB) Create

func (m *MongoDB) Create(ctx context.Context, kind, id string, entity interface{}) error

func (*MongoDB) Find

func (*MongoDB) Get

func (m *MongoDB) Get(ctx context.Context, kind, id string, v interface{}) error

func (*MongoDB) Put

func (m *MongoDB) Put(ctx context.Context, kind, id string, entity interface{}) error

func (*MongoDB) Update

func (m *MongoDB) Update(ctx context.Context, kind, id string, factory datastore.Factory, updater datastore.Updater) error

type Option

type Option func(*MongoDB)

func WithAuthenticationFile added in v0.9.1

func WithAuthenticationFile(usernameFile, passwordFile string) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

Jump to

Keyboard shortcuts

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