mongo

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

mongo provides the Mongo implementation of the StoreClient interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config db.DatabaseInfo) (client interfaces.StoreClient, err error)

NewClient provides a factory for building a StoreClient

Types

type Client

type Client struct {
	Timeout time.Duration
	Client  *mongo.Database
	// contains filtered or unexported fields
}

Client provides a wrapper for Mongo's Client type

func (Client) Disconnect

func (c Client) Disconnect() error

func (Client) RemoveFromStore

func (c Client) RemoveFromStore(o contracts.StoredObject) error

RemoveFromStore removes an object from the data store.

func (Client) RetrieveFromStore

func (c Client) RetrieveFromStore(appServiceKey string) (objects []contracts.StoredObject, err error)

RetrieveFromStore gets an object from the data store.

func (Client) Store

func (c Client) Store(o contracts.StoredObject) (string, error)

Store persists a stored object to the data store.

func (Client) Update

func (c Client) Update(o contracts.StoredObject) error

Update replaces the data currently in the store with the provided data.

Directories

Path Synopsis
models describes the data types that will be used when storing export data in Mongo.
models describes the data types that will be used when storing export data in Mongo.

Jump to

Keyboard shortcuts

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