mongodb

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the client responsible for querying mongodb

func NewClient

func NewClient(ctx context.Context, g generator, cfg Config) (*Client, error)

NewClient returns a new mongodb Client

func (*Client) AddFilterDimension

func (c *Client) AddFilterDimension(ctx context.Context, fID string, dimension model.Dimension) error

func (*Client) Checker

func (c *Client) Checker(ctx context.Context, state *healthcheck.CheckState) error

Checker is called by the healthcheck library to check the health state of this mongoDB instance

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

Close represents mongo session closing within the context deadline

func (*Client) Conn

func (c *Client) Conn() *mongo.MongoConnection

Conn returns the underlying mongodb connection.

func (*Client) CreateEtag

func (c *Client) CreateEtag(current, update interface{}) (eTag string, err error)

CreateEtag creates a new etag for when an update request is made.

func (*Client) CreateFilter

func (c *Client) CreateFilter(ctx context.Context, f *model.Filter) error

CreateFilter creates a new Filter in the CantabularFilters collection

func (*Client) CreateFilterOutput

func (c *Client) CreateFilterOutput(ctx context.Context, f *model.FilterOutput) error

CreateFilterOutput creates a new FilterOutputs in the CantabularFilters colllection

func (*Client) GetFilter

func (c *Client) GetFilter(ctx context.Context, fID string) (*model.Filter, error)

GetFilter gets a filter doc from the filters collections

func (*Client) GetFilterDimensions

func (c *Client) GetFilterDimensions(ctx context.Context, fID string, limit, offset int) ([]model.Dimension, int, error)

GetFilterDimensions gets the dimensions for a Filter in the CantabularFilters collection

type Collection

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

Collection represents a collection in mongodb. Holds The name(s), lock client and any other relevant information.

type Collections

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

Collections holds information about the mongodb collections relevant to this service

type Config

type Config struct {
	mongo.MongoDriverConfig
	FilterFlexAPIURL        string
	FiltersCollection       string
	FilterOutputsCollection string
}

Config holds the config for the mongodb store

Jump to

Keyboard shortcuts

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