expressionDB

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

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 (*ExpressionDB) CreateExpression

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

func (*ExpressionDB) CreateModule

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) 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 expression shared and source code field!

Jump to

Keyboard shortcuts

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