mongo

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 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

	Connection *mongoDriver.MongoConnection
	// contains filtered or unexported fields
}

func NewMongoStore

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

NewMongoStore creates a connection to mongo database

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 connection to the database

func (*Mongo) GetCacheTime

func (m *Mongo) GetCacheTime(ctx context.Context, id string) (*models.CacheTime, error)

GetCacheTime returns a cache time with its given id

func (*Mongo) IsConnected

func (m *Mongo) IsConnected(ctx context.Context) bool

IsConnected return the connection status to the db

func (*Mongo) UpsertCacheTime

func (m *Mongo) UpsertCacheTime(ctx context.Context, cacheTime *models.CacheTime) (err error)

UpsertCacheTime adds or overrides an existing cache time

Jump to

Keyboard shortcuts

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