Documentation ¶
Index ¶
- Constants
- func CheckIfFatal(inErr error) (err error)
- func CloseDB() error
- func DBShowAllTrace() (output []string, err errors.Error)
- func DeactivateExperiment(ctx context.Context, uid string) (err errors.Error)
- func GetDBStatus() (err errors.Error)
- func InsertExperiment(ctx context.Context, data *grpc.Experiment) (result *grpc.Experiment, err errors.Error)
- func SaveLog(log *Log) (err errors.Error)
- func SelectExperiment(ctx context.Context, rowId uint64, uid string) (result *grpc.Experiment, err errors.Error)
- func SelectExperimentWide(ctx context.Context, uid string) (result *grpc.Experiment, err errors.Error)
- func StartDB(ctx context.Context) (msgC chan string, errorC chan *DBErrorMsg, err errors.Error)
- type DBErr
- type DBErrorMsg
- type ExperimentData
- type Log
Constants ¶
const ExpectedDBVersion int64 = 1
Variables ¶
This section is empty.
Functions ¶
func CheckIfFatal ¶
CheckIfFatal is used to handle the errors being returned from the Postgres driver. If errors exist that are not recoverable that relate to schema issues, such as missing columns, indexes and generally expected Database artifacts then this function will kill the task in which they are running.
func CloseDB ¶
func CloseDB() error
CloseDB is used to close any existing database connections to the Experiment DB
func DBShowAllTrace ¶
showAllTrace is a utility function useful for when the database comes up to dump information about the session and other parameters that can be useful in debugging issues with parameters set by the operational side of the system. Its output is generally intended for engineering and thrid level support personnel
func DeactivateExperiment ¶
DeactivateExperiment is used to conceal experiments from future operations unless special flags are set. It is used where otherwise the experiment would be delete but we need to retain a record of it having existed.
func GetDBStatus ¶
Status is used to retrieve the main eco system status from a server. This function will return an error value of nil if the DB is running for a useful error for why it might not be running
func InsertExperiment ¶
func InsertExperiment(ctx context.Context, data *grpc.Experiment) (result *grpc.Experiment, err errors.Error)
InsertExperiment is used to insert a single dataset record into the postgres database. A unique ID will be generated by the insertion operation and this ID will be placed into the returned record so that the caller has a unique reference to the inserted data for use in either performing other database operations or making reference to the project from other records.
The result returned this function does not share memory with the input data parameter and is a deep copy. This is slight less efficent than returning the mutated input structure but safer in regards to potential side effects as a result of assumptions made by the caller.
func SaveLog ¶
SaveLog is used to insert a logging record either originating from the master, or from a client into the logging table
func SelectExperiment ¶
func SelectExperiment(ctx context.Context, rowId uint64, uid string) (result *grpc.Experiment, err errors.Error)
SelectExperiment is used to retrieve one or more experiments that have been registered with the service.
If the rowId is specified, that is not 0, then the database specific row identifier will be used to retrieve a single row. If the rowId is not specified then the application unique identifier will be used to retrieve the experiment.
The function will return a nil the first returned parameter, along with a nil for the error in the case the SQL query works but returns no data.
This function will NOT return layer information.
func SelectExperimentWide ¶
func SelectExperimentWide(ctx context.Context, uid string) (result *grpc.Experiment, err errors.Error)
SelectExperimentWide is used to retrieve one or more experiments that have been registered with the service along with all of the layer details.
The application unique identifier will be used to retrieve the experiment.
The function can return both a nil, or an empty array for the first result, along with a nil for the error in the case the SQL query works but returns no data.
For a single experiment this function will return one row for every layer that was found.