mongodb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled    bool   `description:"Enable MongoDB metadata provider"`
	Name       string `description:"MongoDB database name"`
	Password   string `description:"MongoDB database password"`
	Collection string `description:"MongoDB database collection to use"`
	Port       int    `description:"MongoDB server port"`
}

Config used to setup a MongoDB metastore provider

type MongoDB

type MongoDB struct {
	Session    *mongo.Session
	Collection *mongo.Collection
}

MongoDB handles the connection to an external Mongo database

func NewMongoDB

func NewMongoDB(config *Config) (*MongoDB, error)

NewMongoDB creates a new MongoDB object

func (*MongoDB) Close

func (db *MongoDB) Close()

Close cleans up the connection to Mongo

func (*MongoDB) CreateEventMeta

func (db *MongoDB) CreateEventMeta(eventMeta *documentstorage.EventMeta) error

CreateEventMeta creates a new event context document

func (*MongoDB) CreateInsight

func (db *MongoDB) CreateInsight(insight *documentstorage.Insight) error

CreateInsight creates an insights document

func (*MongoDB) GetEventMetaByID

func (db *MongoDB) GetEventMetaByID(id string) (*documentstorage.EventMeta, error)

GetEventMetaByID returns a single document matching a given document ID

Jump to

Keyboard shortcuts

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