mongo

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 9 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 {
	Database   string
	Collection string
	Connection *dpMongoDriver.MongoConnection
	Username   string
	Password   string
	URI        string
	IsSSL      bool
	// contains filtered or unexported fields
}

Mongo represents a simplistic MongoDB configuration.

func (*Mongo) CheckAreaExists added in v0.3.0

func (m *Mongo) CheckAreaExists(ctx context.Context, id string) error

CheckAreaExists checks that the area exists

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 closes the mongo session and returns any error

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

func (*Mongo) Init

func (m *Mongo) Init(ctx context.Context, shouldEnableReadConcern, shouldEnableWriteConcern bool) error

Init creates a new mongoConnection with a strong consistency and a write mode of "majority".

Jump to

Keyboard shortcuts

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