mongo

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	mongodriver.MongoDriverConfig
	// contains filtered or unexported fields
}

func NewMongoStore added in v0.8.0

func NewMongoStore(_ context.Context, cfg config.MongoConfig) (m *Mongo, err error)

NewMongoStore creates a new Mongo object encapsulating a connection to the mongo server/cluster with the given configuration, and a health client to check the health of the mongo server/cluster

func (*Mongo) Checker

func (m *Mongo) 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 (*Mongo) Close

func (m *Mongo) Close(ctx context.Context) error

Close the mongo session and returns any error It is an error to call m.Close if m.Init() returned an error, and there is no open connection

func (*Mongo) GetArea added in v0.3.0

func (m *Mongo) GetArea(ctx context.Context, id string) (*models.Area, error)

GetArea retrieves a area document by its ID

func (*Mongo) GetAreas added in v0.3.0

func (m *Mongo) GetAreas(ctx context.Context, offset, limit int) (*models.AreasResults, error)

GetAreas retrieves all areas documents

func (*Mongo) GetVersion added in v0.3.0

func (m *Mongo) GetVersion(ctx context.Context, id string, versionID int) (*models.Area, error)

GetVersion retrieves a version document for the area

Jump to

Keyboard shortcuts

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