mongo

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 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 Mongo

type Mongo struct {
	config.MongoConfig

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

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 represents mongo session closing within the context deadline

func (*Mongo) CreateBundle

func (m *Mongo) CreateBundle(ctx context.Context, bundle *models.Bundle) error

CreateBundle inserts a new bundle

func (*Mongo) DeleteBundle

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

DeleteBundle deletes a bundle by ID

func (*Mongo) GetBundle

func (m *Mongo) GetBundle(ctx context.Context, bundleID string) (*models.Bundle, error)

GetBundle retrieves a single bundle by ID

func (*Mongo) Init

func (m *Mongo) Init(ctx context.Context) (err error)

Init returns an initialised Mongo object encapsulating a connection to the mongo server/cluster with the given configuration, a health client to check the health of the mongo server/cluster, and a lock client

func (*Mongo) ListBundles

func (m *Mongo) ListBundles(ctx context.Context, offset, limit int) (bundles []*models.Bundle, totalCount int, err error)

ListBundles retrieves all bundles

func (*Mongo) UpdateBundle

func (m *Mongo) UpdateBundle(ctx context.Context, id string, update *models.Bundle) (*models.Bundle, error)

Jump to

Keyboard shortcuts

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