mongodb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Key   string `bson:"_id"`
	Value string `bson:"value"`
}

Mongodb document wrapper

type MongoDB

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

MongoDB is a state store implementation for MongoDB

func NewMongoDB

func NewMongoDB(logger logger.Logger) *MongoDB

NewMongoDBStateStore returns a new MongoDB state store

func (*MongoDB) BulkDelete

func (m *MongoDB) BulkDelete(req []state.DeleteRequest) error

BulkDelete performs a bulk delete operation

func (*MongoDB) BulkSet

func (m *MongoDB) BulkSet(req []state.SetRequest) error

BulkSet performs a bulks save operation

func (*MongoDB) Delete

func (m *MongoDB) Delete(req *state.DeleteRequest) error

Delete performs a delete operation

func (*MongoDB) Get

func (m *MongoDB) Get(req *state.GetRequest) (*state.GetResponse, error)

Get retrieves state from MongoDB with a key

func (*MongoDB) Init

func (m *MongoDB) Init(metadata state.Metadata) error

Init establishes connection to the store based on the metadata

func (*MongoDB) Multi

func (m *MongoDB) Multi(operations []state.TransactionalRequest) error

Multi performs a transactional operation. succeeds only if all operations succeed, and fails if one or more operations fail

func (*MongoDB) Set

func (m *MongoDB) Set(req *state.SetRequest) error

Set saves state into MongoDB

Jump to

Keyboard shortcuts

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