Documentation
¶
Index ¶
- func SetupIndexes(ctx context.Context, mimServer *mim.Server) error
- type Mongo
- func (m *Mongo) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
- func (m *Mongo) CheckBundleExists(ctx context.Context, bundleID string) (bool, error)
- func (m *Mongo) CheckContentItemExistsByDatasetEditionVersion(ctx context.Context, datasetID, editionID string, versionID int) (bool, error)
- func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (m *Mongo) Close(ctx context.Context) error
- func (m *Mongo) CreateBundle(ctx context.Context, bundle *models.Bundle) error
- func (m *Mongo) CreateBundleEvent(ctx context.Context, event *models.Event) error
- func (m *Mongo) CreateContentItem(ctx context.Context, contentItem *models.ContentItem) error
- func (m *Mongo) DeleteBundle(ctx context.Context, id string) (err error)
- func (m *Mongo) GetBundle(ctx context.Context, bundleID string) (*models.Bundle, error)
- func (m *Mongo) GetBundleEvent(ctx context.Context, bundleID string) (*models.Event, error)
- func (m *Mongo) Init(ctx context.Context) (err error)
- func (m *Mongo) ListBundleEvents(ctx context.Context, offset, limit int, bundleID string, ...) (events []*models.Event, totalCount int, err error)
- func (m *Mongo) ListBundles(ctx context.Context, offset, limit int, filters *filters.BundleFilters) (bundles []*models.Bundle, totalCount int, err error)
- func (m *Mongo) UpdateBundle(ctx context.Context, id string, update *models.Bundle) (*models.Bundle, error)
- func (m *Mongo) UpdateBundleETag(ctx context.Context, bundleID, email string) (*models.Bundle, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mongo ¶
type Mongo struct {
config.MongoConfig
Connection *mongodriver.MongoConnection
// contains filtered or unexported fields
}
func (*Mongo) CheckAllBundleContentsAreApproved ¶ added in v1.2.0
func (m *Mongo) CheckAllBundleContentsAreApproved(ctx context.Context, bundleID string) (bool, error)
CheckAllBundleContentsAreApproved checks if all contents of a bundle are in the approved state
func (*Mongo) CheckBundleExists ¶ added in v1.3.0
CheckBundleExists checks if a bundle exists by ID
func (*Mongo) CheckContentItemExistsByDatasetEditionVersion ¶ added in v1.3.0
func (m *Mongo) CheckContentItemExistsByDatasetEditionVersion(ctx context.Context, datasetID, editionID string, versionID int) (bool, error)
CheckContentItemExistsByDatasetEditionVersion checks if a content item exists with the specified dataset, edition, and version
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) CreateBundle ¶
CreateBundle inserts a new bundle
func (*Mongo) CreateBundleEvent ¶ added in v1.2.0
CreateBundleEvent inserts a new bundle event
func (*Mongo) CreateContentItem ¶ added in v1.3.0
CreateContentItem inserts a new content item into the database
func (*Mongo) DeleteBundle ¶
DeleteBundle deletes a bundle by ID
func (*Mongo) GetBundleEvent ¶ added in v1.3.0
GetBundleEvent retrieves an event by Bundle ID
func (*Mongo) Init ¶
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) ListBundleEvents ¶ added in v1.3.0
func (m *Mongo) ListBundleEvents(ctx context.Context, offset, limit int, bundleID string, after, before *time.Time) (events []*models.Event, totalCount int, err error)
ListBundleEvents retrieves all bundle events with optional filtering and pagination
func (*Mongo) ListBundles ¶
func (m *Mongo) ListBundles(ctx context.Context, offset, limit int, filters *filters.BundleFilters) (bundles []*models.Bundle, totalCount int, err error)
ListBundles retrieves all bundles based on the provided offset, limit, and BundleFilters