mongodb

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 13 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, dim model.Dimension) error

func (*Client) AddFilterOutputEvent added in v1.2.0

func (c *Client) AddFilterOutputEvent(ctx context.Context, id string, f *model.Event) error

AddFilterOutputEvent will append to the existing list of events in the filter output

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 collection

func (*Client) DeleteFilterDimension added in v1.6.0

func (c *Client) DeleteFilterDimension(ctx context.Context, filterID, dimensionName string) (string, error)

DeleteFilterDimension deletes a given dimension in a Filter etag checks should haev passed before calling this function

func (*Client) DeleteFilterDimensionOptions added in v1.2.0

func (c *Client) DeleteFilterDimensionOptions(ctx context.Context, filterID, dimensionName string) (string, error)

DeleteFilterDimensionOptions deletes all options for a given dimension in a Filter by the time that it gets to here, you should actually have determined that the etag is fine

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) GetFilterDimension added in v1.2.0

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

GetFilterDimension gets a specific dimensions for a Filter in the CantabularFilters collection

func (*Client) GetFilterDimensionOptions added in v1.2.0

func (c *Client) GetFilterDimensionOptions(ctx context.Context, filterID, dimensionName string, limit, offset int) (finalOptions []string, totalCount int, eTag string, err error)

GetFilterDimensionOptions gets the options for a dimension that is part of a Filter

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

func (*Client) GetFilterOutput added in v1.2.0

func (c *Client) GetFilterOutput(ctx context.Context, filterID string) (*model.FilterOutput, error)

GetFilterOutput

func (*Client) RemoveFilterDimensionOption added in v1.2.0

func (c *Client) RemoveFilterDimensionOption(ctx context.Context, filterID, dimension, option, currentETag string) (string, error)

func (*Client) UpdateFilterDimension added in v1.2.0

func (c *Client) UpdateFilterDimension(ctx context.Context, filterID, dimensionName string, dimension model.Dimension, currentETag string) (string, error)

func (*Client) UpdateFilterOutput added in v1.2.0

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

UpdateFilterOutput creates/updates a FilterOutputs 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
	FilterAPIURL            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