pkg

package
v0.0.0-...-8a59935 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Key   string `bson:"_id" json:"Key"`
	Value []byte `bson:"Value" json:"Value"`
}

Data is a wrapper for the stored key/value pair

type Option

type Option func(opts *Provider)

Option configures the mongodb provider.

func WithDBPrefix

func WithDBPrefix(dbPrefix string) Option

WithDBPrefix option is for adding prefix to db name.

type Provider

type Provider struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Provider mongodb implementation of storage.Provider interface

func NewProvider

func NewProvider(dial string, opts ...Option) *Provider

NewProvider instantiates Provider

func (*Provider) Close

func (r *Provider) Close() error

Close closes all stores created under this store provider

func (*Provider) CloseStore

func (r *Provider) CloseStore(name string) error

CloseStore closes level name store of given name

func (*Provider) OpenStore

func (r *Provider) OpenStore(name string) (storage.Store, error)

OpenStore opens and returns a store for given name space.

Jump to

Keyboard shortcuts

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