expressionDB

package
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Contains all functionality to access expressions and modules from Mongo DB

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpressionDB

type ExpressionDB struct {
	Svcs *services.APIServices

	Database       *mongo.Database
	Expressions    *mongo.Collection
	Modules        *mongo.Collection
	ModuleVersions *mongo.Collection
}

func MakeExpressionDB

func MakeExpressionDB(
	envName string,
	svcs *services.APIServices,
) *ExpressionDB

func (*ExpressionDB) AddModuleVersion

func (e *ExpressionDB) AddModuleVersion(moduleID string, input modules.DataModuleVersionInput, publishDOI bool) (modules.DataModuleSpecificVersionWire, error)

func (*ExpressionDB) CreateExpression

func (e *ExpressionDB) CreateExpression(input expressions.DataExpressionInput, creator pixlUser.UserInfo, createShared bool) (expressions.DataExpression, error)

func (*ExpressionDB) CreateModule

func (e *ExpressionDB) CreateModule(
	input modules.DataModuleInput,
	creator pixlUser.UserInfo,
	publishDOI bool,
) (modules.DataModuleSpecificVersionWire, error)

func (*ExpressionDB) DeleteExpression

func (e *ExpressionDB) DeleteExpression(expressionID string) error

func (*ExpressionDB) GetExpression

func (e *ExpressionDB) GetExpression(expressionID string, retrieveUpdatedUserInfo bool) (expressions.DataExpression, error)

func (*ExpressionDB) GetModule

func (e *ExpressionDB) GetModule(moduleID string, version *modules.SemanticVersion, retrieveUpdatedUserInfo bool) (modules.DataModuleSpecificVersionWire, error)

func (*ExpressionDB) IsNotFoundError

func (e *ExpressionDB) IsNotFoundError(err error) bool

func (*ExpressionDB) ListExpressions

func (e *ExpressionDB) ListExpressions(userID string, includeShared bool, retrieveUpdatedUserInfo bool) (expressions.DataExpressionLookup, error)

func (*ExpressionDB) ListModules

func (e *ExpressionDB) ListModules(retrieveUpdatedUserInfo bool) (modules.DataModuleWireLookup, error)

ListModules - Lists all modules, returning a map of Module ID->Module, which contains a list of all module versions (with their tags). Note, this does

func (*ExpressionDB) PublishExpressionToZenodo added in v3.3.2

func (e *ExpressionDB) PublishExpressionToZenodo(expressionID string, zipData []byte, zenodoURI string, zenodoToken string) (expressions.DataExpression, error)

func (*ExpressionDB) StoreExpressionRecentRunStats

func (e *ExpressionDB) StoreExpressionRecentRunStats(expressionID string, stats expressions.DataExpressionExecStats) error

func (*ExpressionDB) UpdateExpression

func (e *ExpressionDB) UpdateExpression(
	expressionID string,
	input expressions.DataExpressionInput,
	creator pixlUser.UserInfo,
	createdUnixTimeSec int64,
	isShared bool,
	existingSourceCode string,
) (expressions.DataExpression, error)

Replaces the existing expression with the new one This assumes a GetExpression was required already to validate user permissions to this expression, etc therefore the prevUnixTime should be available. This way we can preserve the creation time but set a new modified time now. Also now requires the existing expressƒion shared and source code field!

Jump to

Keyboard shortcuts

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