dbs

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GenericErrorCode              = iota + 100 // generic DBS error
	DatabaseErrorCode                          // 101 database error
	TransactionErrorCode                       // 102 transaction error
	QueryErrorCode                             // 103 query error
	RowsScanErrorCode                          // 104 row scan error
	SessionErrorCode                           // 105 db session error
	CommitErrorCode                            // 106 db commit error
	ParseErrorCode                             // 107 parser error
	LoadErrorCode                              // 108 loading error, e.g. load template
	GetIDErrorCode                             // 109 get id db error
	InsertErrorCode                            // 110 db insert error
	UpdateErrorCode                            // 111 update error
	DeleteErrorCode                            // 112 error error
	LastInsertErrorCode                        // 113 db last insert error
	ValidateErrorCode                          // 114 validation error
	PatternErrorCode                           // 115 pattern error
	DecodeErrorCode                            // 116 decode error
	EncodeErrorCode                            // 117 encode error
	ContentTypeErrorCode                       // 118 content type error
	ParametersErrorCode                        // 119 parameters error
	NotImplementedApiCode                      // 120 not implemented API error
	ReaderErrorCode                            // 121 io reader error
	WriterErrorCode                            // 122 io writer error
	UnmarshalErrorCode                         // 123 json unmarshal error
	MarshalErrorCode                           // 124 marshal error
	HttpRequestErrorCode                       // 125 HTTP request error
	MigrationErrorCode                         // 126 Migration error
	RemoveErrorCode                            // 127 remove error
	InvalidRequestErrorCode                    // 128 invalid request error
	PackagesErrorCode                          // 129 packages error code
	ManyToManyErrorCode                        // 130 many-to-many insertion error code
	DatasetErrorCode                           // 131 dataset error code
	EnvironmentsErrorCode                      // 132 environments error code
	FilesErrorCode                             // 133 files error code
	OsInfoErrorCode                            // 134 osinfo error code
	ParentsErrorCode                           // 135 parents error code
	ProcessingErrorCode                        // 136 processing error code
	ScriptsErrorCode                           // 137 scripts error code
	SitesErrorCode                             // 138 sites error code
	UnsupportedOperationErrorCode              // 140 unsupported operation error code
	LastAvailableErrorCode                     // last available DBS error code
)

DBS Error codes provides static representation of DBS errors, they cover 1xx range

Variables

View Source
var ConcurrencyErr = errors.New("concurrency error")

ConcurrencyErr represents generic concurrency error

View Source
var ConcurrentBulkBlocks bool

ConcurrentBulkBlocks defines if code should use concurrent bulkblocks API

View Source
var ContentTypeErr = errors.New("content-type error")

ContentTypeErr represents generic content-type error

View Source
var DB *sql.DB

DB represents sql DB pointer

View Source
var DBOWNER string

DBOWNER represents DBS DB owner

View Source
var DBSQL map[string]any

DBSQL represents DBS SQL record

View Source
var DBTYPE string

DBTYPE represents DBS DB type, e.g. ORACLE or SQLite

View Source
var DRYRUN bool

DRYRUN allows to skip query execution and printout DB statements along with passed parameters

View Source
var DatabaseErr = errors.New("database error")

DatabaseErr represents generic database error

View Source
var FileLumiChunkSize int

FileLumiChunkSize controls chunk size for FileLumi list insertion

View Source
var FileLumiInsertMethod string

FileLumiInsertMethod controls which method to use for insertion of FileLumi list

View Source
var FileLumiMaxSize int

FileLumiMaxSize controls max size for FileLumi list insertion

View Source
var GenericErr = errors.New("dbs error")

GenericErr represents generic dbs error

View Source
var InvalidParamErr = errors.New("invalid parameter(s)")

InvalidParamErr represents generic error for invalid input parameter

View Source
var InvalidRequestErr = errors.New("invalid request error")

InvalidRequestErr represents generic invalid request error

View Source
var NotImplementedApiErr = errors.New("not implemented api error")

NotImplementedApiErr represents generic not implemented api error

View Source
var RecordErr = errors.New("record error")

RecordErr represents generic record error

View Source
var RecordValidator *validator.Validate

RecordValidator pointer to validator Validate method

View Source
var StaticDir string

StaticDir provides location of static directory

View Source
var Timeout int

Timeout represents DBS timeout used by HttpClient

View Source
var ValidationErr = errors.New("validation error")

ValidationErr represents generic validation error

View Source
var Verbose int

Verbose controls verbosity level

Functions

func AddParam

func AddParam(
	name, sqlName string,
	params map[string]any,
	conds []string,
	args []interface{}) ([]string, []interface{})

AddParam adds single parameter to SQL statement

func CastInt

func CastInt(val interface{}) (int, error)

CastInt function to check and cast interface{} to int data-type

func CastInt64

func CastInt64(val interface{}) (int64, error)

CastInt64 function to check and cast interface{} to int64 data-type

func CastString

func CastString(val interface{}) (string, error)

CastString function to check and cast interface{} to string data-type

func CleanStatement

func CleanStatement(stm string) string

CleanStatement cleans the given SQL statement to remove empty strings, etc.

func ConvertFloat

func ConvertFloat(val string) string

ConvertFloat converts string representation of float scientific number to string int

func DBOperation added in v0.1.8

func DBOperation(op string, rec DBRecord, data []byte, msg string) error

DBOperation performs transactional operation in database for provided record

func Date

func Date() int64

Date provides default date for DB records

func DecodeValidatorError

func DecodeValidatorError(r, err interface{}) error

DecodeValidatorError provides uniform error representation of DBRecord validation errors

func Error

func Error(err error, code int, msg, function string) error

helper function to create dbs error

func GetChunks

func GetChunks(vals []string, limit int) []string

GetChunks helper function to get ORACLE chunks from provided list of values

func GetID

func GetID(tx *sql.Tx, table, id, attr string, val ...interface{}) (int64, error)

GetID function fetches table primary id for a given value

func GetRecID

func GetRecID(tx *sql.Tx, rec DBRecord, table, id, attr string, val ...interface{}) (int64, error)

GetRecID function fetches table primary id for a given value and insert it if necessary

func GetTestData

func GetTestData() error

GetTestData executes simple query to ensure that connection to DB is valid. So far we can ask for a data tier id of specific tier since this table is very small and query execution will be really fast.

func HttpClient

func HttpClient(tout int) *http.Client

HttpClient is HTTP client for urlfetch server

func IfExist

func IfExist(tx *sql.Tx, table, rid, attr string, val ...interface{}) bool

IfExist check if given rid, attr exists in given table for provided value conditions

func IfExistMulti

func IfExistMulti(tx *sql.Tx, table, rid string, args []string, vals ...interface{}) bool

IfExistMulti checks if given rid exists in given table for provided value conditions

func IncrementSequence

func IncrementSequence(tx *sql.Tx, seq string) (int64, error)

IncrementSequence API returns single unique ID for a given sequence

func IncrementSequences

func IncrementSequences(tx *sql.Tx, seq string, n int) ([]int64, error)

IncrementSequences API provide a way to get N unique IDs for given sequence name

func InsertManyToMany added in v0.1.7

func InsertManyToMany(tx *sql.Tx, tmplName string, args ...interface{}) error

InsertManyToMany provides function to insert many-to-many relationship from given template name and set of parameters

func LastInsertID

func LastInsertID(tx *sql.Tx, table, idName string) (int64, error)

LastInsertID returns last insert id of given table and idname parameter

func ListFiles

func ListFiles(dir string) []string

ListFiles lists files in a given directory

func LoadSQL

func LoadSQL(owner string) map[string]any

LoadSQL function loads DBS SQL statements with Owner

func LoadTemplateSQL

func LoadTemplateSQL(tmpl string, tmplData map[string]any) (string, error)

LoadTemplateSQL function loads DBS SQL templated statements

func OperatorValue

func OperatorValue(arg string) (string, string)

OperatorValue function generates operator and value pair for a given argument

func ParseRuns

func ParseRuns(runs []string) ([]string, error)

ParseRuns parse run_num parameter and convert it to run list

func ParseTmpl

func ParseTmpl(tdir, tmpl string, data interface{}) (string, error)

ParseTmpl parses template with given data

func PrintSQL

func PrintSQL(stm string, args []interface{}, msg string)

PrintSQL prints SQL/args

func QueryRow

func QueryRow(table, id, attr string, val interface{}) (int64, error)

QueryRow function fetches results from given table

func ReplaceBinds

func ReplaceBinds(stm string) string

ReplaceBinds replaces given pattern in string

func RunsConditions

func RunsConditions(runs []string, table string) (string, []string, []interface{}, error)

RunsConditions function to handle runs conditions

func TokenCondition

func TokenCondition() string

TokenCondition provides proper condition statement for TokenGenerator

func TokenGenerator

func TokenGenerator(runs []string, limit int, name string) (string, []string)

TokenGenerator creates a SQL token generator statement

func TokenGeneratorORACLE

func TokenGeneratorORACLE(runs []string, limit int, name string) (string, []string)

TokenGeneratorORACLE creates a SQL token generator statement using ORACLE syntax https://betteratoracle.com/posts/20-how-do-i-bind-a-variable-in-list

func TokenGeneratorSQLite

func TokenGeneratorSQLite(runs []string, name string) (string, []string)

TokenGeneratorSQLite creates a SQL token generator statement using SQLite syntax https://stackoverflow.com/questions/67372811/what-is-equivalent-of-token-generator-oracle-sql-statement-in-sqlite

func UniqueList added in v0.1.7

func UniqueList(input []string) []string

UniqueList removes duplicates from a slice and returns a new slice with unique elements.

func WhereClause

func WhereClause(stm string, conds []string) string

WhereClause function construct proper SQL statement from given statement and list of conditions

Types

type API

type API struct {
	Reader      io.Reader           // reader to read data payload
	Writer      http.ResponseWriter // writer to write results back to client
	Context     context.Context     // HTTP context
	ContentType string              // HTTP content-type
	Params      map[string]any      // HTTP parameters, i.e. map of any data type
	Separator   string              // string separator for ndjson format
	CreateBy    string              // create by value from run-time
	Api         string              // api name
}

API structure represents DBS API. Each API has reader (to read HTTP POST payload), HTTP writer to write results back to client, HTTP context, input HTTP GET paramers, separator for writer, create by and api string values passed at run-time.

func (*API) DeleteBucket

func (a *API) DeleteBucket() error

DeleteBucket deletes bucket record in DB

func (*API) DeleteDataset

func (a *API) DeleteDataset() error

func (*API) DeleteEnvironment added in v0.1.7

func (a *API) DeleteEnvironment() error

DeleteEnvironment deletes environment record in DB

func (*API) DeleteFile

func (a *API) DeleteFile() error

func (*API) DeleteOsInfo added in v0.1.7

func (a *API) DeleteOsInfo() error

DeleteOsInfo deletes osinfo record in DB

func (*API) DeletePackage added in v0.1.7

func (a *API) DeletePackage() error

DeletePackage deletes package record in DB

func (*API) DeleteParent

func (a *API) DeleteParent() error

DeleteParent deletes parent record in DB

func (*API) DeleteProcessing

func (a *API) DeleteProcessing() error

DeleteProcessing deletes processing record in DB

func (*API) DeleteScript added in v0.1.7

func (a *API) DeleteScript() error

DeleteScript deletes script record in DB

func (*API) DeleteSite

func (a *API) DeleteSite() error

DeleteSite deletes site record in DB

func (*API) GetBucket

func (a *API) GetBucket() error

Buckets DBS API

func (*API) GetChild added in v0.0.4

func (a *API) GetChild() error

Children DBS API

func (*API) GetDataset

func (a *API) GetDataset() error

Datasets API

func (*API) GetEnvironment added in v0.1.7

func (a *API) GetEnvironment() error

Environments DBS API

func (*API) GetFile

func (a *API) GetFile() error

Files DBS API

func (*API) GetOsInfo added in v0.1.7

func (a *API) GetOsInfo() error

OsInfo DBS API

func (*API) GetPackage added in v0.1.7

func (a *API) GetPackage() error

Packages DBS API

func (*API) GetParent

func (a *API) GetParent() error

Parents DBS API

func (*API) GetParentDID added in v0.1.7

func (a *API) GetParentDID(did string) (string, error)

func (*API) GetProcessing

func (a *API) GetProcessing() error

Processing DBS API

func (*API) GetProvenance added in v0.1.7

func (a *API) GetProvenance() error

func (*API) GetScript added in v0.1.7

func (a *API) GetScript() error

Scripts DBS API

func (*API) GetSite

func (a *API) GetSite() error

Sites DBS API

func (*API) InsertBucket

func (a *API) InsertBucket() error

InsertBucket inserts bucket record into DB

func (*API) InsertDataset

func (a *API) InsertDataset() error

InsertDataset inserts dataset into database

func (*API) InsertEnvironment added in v0.1.7

func (a *API) InsertEnvironment() error

InsertEnvironment inserts environment record into DB

func (*API) InsertFile

func (a *API) InsertFile() error

func (*API) InsertOsInfo added in v0.1.7

func (a *API) InsertOsInfo() error

InsertOsInfo inserts osinfo record into DB

func (*API) InsertPackage added in v0.1.7

func (a *API) InsertPackage() error

InsertPackage inserts package record into DB

func (*API) InsertParent

func (a *API) InsertParent() error

InsertParent inserts parent record into DB

func (*API) InsertProcessing

func (a *API) InsertProcessing() error

InsertProcessing inserts processing record into DB

func (*API) InsertScript added in v0.1.7

func (a *API) InsertScript() error

InsertScript inserts script record into DB

func (*API) InsertSite

func (a *API) InsertSite() error

InsertSite inserts site record into DB

func (*API) String

func (a *API) String() string

String provides string representation of API struct

func (*API) UpdateBucket

func (a *API) UpdateBucket() error

UpdateBucket inserts bucket record in DB

func (*API) UpdateDataset

func (a *API) UpdateDataset() error

func (*API) UpdateEnvironment added in v0.1.7

func (a *API) UpdateEnvironment() error

UpdateEnvironment inserts environment record in DB

func (*API) UpdateFile

func (a *API) UpdateFile() error

func (*API) UpdateOsInfo added in v0.1.7

func (a *API) UpdateOsInfo() error

UpdateOsInfo inserts osinfo record in DB

func (*API) UpdatePackage added in v0.1.7

func (a *API) UpdatePackage() error

UpdatePackage inserts package record in DB

func (*API) UpdateParent

func (a *API) UpdateParent() error

UpdateParent inserts parent record in DB

func (*API) UpdateProcessing

func (a *API) UpdateProcessing() error

UpdateProcessing inserts processing record in DB

func (*API) UpdateScript added in v0.1.7

func (a *API) UpdateScript() error

UpdateScript inserts script record in DB

func (*API) UpdateSite

func (a *API) UpdateSite() error

UpdateSite inserts site record in DB

type BucketRecord added in v0.1.7

type BucketRecord struct {
	Name     string `json:"name"`
	UUID     string `json:"uuid"`
	MetaData string `json:"meta_data"`
}

BucketRecord represents bucket input data record

func UniqueBucketRecords added in v0.1.7

func UniqueBucketRecords(bucketRecords []BucketRecord) []BucketRecord

UniqueBucketRecords removes duplicates from a slice and returns a new slice with unique elements.

func (*BucketRecord) Insert added in v0.1.7

func (e *BucketRecord) Insert(tx *sql.Tx) (int64, error)

Insert API

func (*BucketRecord) Validate added in v0.1.7

func (r *BucketRecord) Validate() error

Validate implementation of BucketRecord

type Buckets

type Buckets struct {
	BUCKET_ID  int64  `json:"bucket_id"`
	BUCKET     string `json:"bucket" validate:"required"`
	UUID       string `json:"uuid"`
	META_DATA  string `json:"meta_data"`
	DATASET_ID int64  `json:"dataset_id" validate:"required"`
	CREATE_AT  int64  `json:"create_at"`
	CREATE_BY  string `json:"create_by"`
	MODIFY_AT  int64  `json:"modify_at"`
	MODIFY_BY  string `json:"modify_by"`
}

Buckets represents Buckets DBS DB table

func (*Buckets) Delete added in v0.1.8

func (r *Buckets) Delete(tx *sql.Tx) error

Delete implementation of Buckets

func (*Buckets) Insert

func (r *Buckets) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Buckets

func (*Buckets) SetDefaults

func (r *Buckets) SetDefaults()

SetDefaults implements set defaults for Buckets

func (*Buckets) Update added in v0.0.3

func (r *Buckets) Update(tx *sql.Tx) error

Update implementation of Buckets

func (*Buckets) Validate

func (r *Buckets) Validate() error

Validate implementation of Buckets

type DBRecord

type DBRecord interface {
	Insert(tx *sql.Tx) (int64, error) // used to insert given record to DB
	Update(tx *sql.Tx) error          // used to update given record to DB
	Delete(tx *sql.Tx) error          // used to delete given record to DB
	Validate() error                  // used to validate given record
	SetDefaults()                     // used to set proper defaults for given record
}

DBRecord interface represents general DB record used by DBS APIs. Each DBS API represents specific Table in back-end DB. And, each individual DBS API implements logic for its own DB records

type DBSError

type DBSError struct {
	Reason     string `json:"reason"`     // error string
	Message    string `json:"message"`    // additional message describing the issue
	Function   string `json:"function"`   // DBS function
	Code       int    `json:"code"`       // DBS error code
	Stacktrace string `json:"stacktrace"` // Go stack trace
}

DBSError represents common structure for DBS errors

func (*DBSError) Error

func (e *DBSError) Error() string

Error function implements details of DBS error message

func (*DBSError) ErrorStacktrace

func (e *DBSError) ErrorStacktrace() string

ErrorStacktrace function implements details of DBS error message and stacktrace

func (*DBSError) Explain

func (e *DBSError) Explain() string

type DatasetRecord

type DatasetRecord struct {
	Did          string              `json:"did" validate:"required"`
	Site         string              `json:"site" validate:"required"`
	Processing   string              `json:"processing" validate:"required"`
	Parent       string              `json:"parent_did" validate:"required"`
	InputFiles   []FileRecord        `json:"input_files,omitempty" validate:"required"`
	OutputFiles  []FileRecord        `json:"output_files,omitempty" validate:"required"`
	Environments []EnvironmentRecord `json:"environments"`
	Scripts      []ScriptRecord      `json:"scripts"`
	Buckets      []BucketRecord      `json:"buckets"`
	OsInfo       OsInfoRecord        `json:"osinfo"`
}

DatasetRecord represents input dataset record from HTTP request

func (*DatasetRecord) Validate added in v0.1.7

func (r *DatasetRecord) Validate() error

Validate implementation of DatasetRecord

type Datasets

type Datasets struct {
	DATASET_ID    int64  `json:"dataset_id"`
	DID           string `json:"did" validate:"required"`
	SITE_ID       int64  `json:"site_id" validate:"required",number`
	PROCESSING_ID int64  `json:"processing_id" validate:"required",number`
	OSINFO_ID     int64  `json:"osinfo_id" validate:"required",number`
	CREATE_AT     int64  `json:"create_at" validate:"required,number"`
	CREATE_BY     string `json:"create_by" validate:"required"`
	MODIFY_AT     int64  `json:"modify_at" validate:"required,number"`
	MODIFY_BY     string `json:"modify_by" validate:"required"`
}

Datasets represents Datasets DBS DB table

func (*Datasets) Delete added in v0.1.8

func (r *Datasets) Delete(tx *sql.Tx) error

Delete implementation of Datasets

func (*Datasets) Insert

func (r *Datasets) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Datasets

func (*Datasets) SetDefaults

func (r *Datasets) SetDefaults()

SetDefaults implements set defaults for Datasets

func (*Datasets) Update added in v0.0.3

func (r *Datasets) Update(tx *sql.Tx) error

Update implementation of Datasets

func (*Datasets) Validate

func (r *Datasets) Validate() error

Validate implementation of Datasets

type EnvironmentRecord added in v0.1.7

type EnvironmentRecord struct {
	Name     string          `json:"name"`
	Version  string          `json:"version"`
	Details  string          `json:"details"`
	Parent   string          `json:"parent_environment"`
	OSName   string          `json:"os_name"`
	Packages []PackageRecord `json:"packages,omitempty"`
}

EnvironmentRecord represents data input for environment record

func (*EnvironmentRecord) Insert added in v0.1.7

func (e *EnvironmentRecord) Insert(tx *sql.Tx) (int64, error)

Insert API

func (*EnvironmentRecord) Validate added in v0.1.7

func (r *EnvironmentRecord) Validate() error

Validate implementation of EnvironmentRecord

type Environments added in v0.1.7

type Environments struct {
	ENVIRONMENT_ID        int64  `json:"environment_id"`
	NAME                  string `json:"name" validate:"required"`
	VERSION               string `json:"version" validate:"required"`
	DETAILS               string `json:"details" validate:"required"`
	OS_ID                 int64  `json:"os_id"`
	PARENT_ENVIRONMENT_ID int64  `json:"parent_environment_id"`
	CREATE_AT             int64  `json:"create_at"`
	CREATE_BY             string `json:"create_by"`
	MODIFY_AT             int64  `json:"modify_at"`
	MODIFY_BY             string `json:"modify_by"`
}

Environments represents Environments DBS DB table

func (*Environments) Delete added in v0.1.8

func (r *Environments) Delete(tx *sql.Tx) error

Delete implementation of Environments

func (*Environments) Insert added in v0.1.7

func (r *Environments) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Environments

func (*Environments) SetDefaults added in v0.1.7

func (r *Environments) SetDefaults()

SetDefaults implements set defaults for Environments

func (*Environments) Update added in v0.1.7

func (r *Environments) Update(tx *sql.Tx) error

Update implementation of Environments

func (*Environments) Validate added in v0.1.7

func (r *Environments) Validate() error

Validate implementation of Environments

type FileRecord added in v0.0.4

type FileRecord struct {
	Name     string `json:"name"`
	Checksum string `json:"checksum",omitempty`
	Size     int64  `json:"size",omitempty`
	IsValid  int64  `json:"isvalid",omitempty`
}

FileRecord represents script input data record

func (*FileRecord) Insert added in v0.1.7

func (r *FileRecord) Insert(tx *sql.Tx) (int64, error)

Insert API

func (*FileRecord) Validate added in v0.1.7

func (r *FileRecord) Validate() error

Validate implementation of FileRecord

type Files

type Files struct {
	FILE_ID       int64  `json:"file_id"`
	FILE          string `json:"file" validate:"required"`
	CHECKSUM      string `json:"checksum" validate`
	SIZE          int64  `json:"size" validate:"number"`
	IS_FILE_VALID int64  `json:"is_file_valid" validate:"number"`
	CREATE_AT     int64  `json:"create_at" validate:"required,number,gt=0"`
	CREATE_BY     string `json:"create_by" validate:"required"`
	MODIFY_AT     int64  `json:"modify_at" validate:"required,number,gt=0"`
	MODIFY_BY     string `json:"modify_by" validate:"required"`
}

Files represents Files DBS DB table

func (*Files) Delete added in v0.1.8

func (r *Files) Delete(tx *sql.Tx) error

Delete implementation of Files

func (*Files) Insert

func (r *Files) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Files

func (*Files) SetDefaults

func (r *Files) SetDefaults()

SetDefaults implements set defaults for Files

func (*Files) Update added in v0.0.3

func (r *Files) Update(tx *sql.Tx) error

Update implementation of Files

func (*Files) Validate

func (r *Files) Validate() error

Validate implementation of Files

type OsInfo added in v0.1.7

type OsInfo struct {
	OS_ID     int64  `json:"os_id"`
	NAME      string `json:"name" validate:"required"`
	VERSION   string `json:"version" validate:"required"`
	KERNEL    string `json:"kernel" validate:"required"`
	CREATE_AT int64  `json:"create_at"`
	CREATE_BY string `json:"create_by"`
	MODIFY_AT int64  `json:"modify_at"`
	MODIFY_BY string `json:"modify_by"`
}

OsInfo represents OsInfo DBS DB table

func (*OsInfo) Delete added in v0.1.8

func (r *OsInfo) Delete(tx *sql.Tx) error

Delete implementation of OsInfo

func (*OsInfo) Insert added in v0.1.7

func (r *OsInfo) Insert(tx *sql.Tx) (int64, error)

Insert implementation of OsInfo

func (*OsInfo) SetDefaults added in v0.1.7

func (r *OsInfo) SetDefaults()

SetDefaults implements set defaults for OsInfo

func (*OsInfo) Update added in v0.1.7

func (r *OsInfo) Update(tx *sql.Tx) error

Update implementation of OsInfo

func (*OsInfo) Validate added in v0.1.7

func (r *OsInfo) Validate() error

Validate implementation of OsInfo

type OsInfoRecord added in v0.1.7

type OsInfoRecord struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Kernel  string `json:"kernel"`
}

OsInfoRecord represent input os info record

func (*OsInfoRecord) Insert added in v0.1.7

func (o *OsInfoRecord) Insert(tx *sql.Tx) (int64, error)

Insert API

func (*OsInfoRecord) Validate added in v0.1.7

func (r *OsInfoRecord) Validate() error

Validate implementation of OsInfoRecord

type PackageRecord added in v0.1.7

type PackageRecord struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

PackageRecord represents data input for package record

func (*PackageRecord) Insert added in v0.1.7

func (e *PackageRecord) Insert(tx *sql.Tx) (int64, error)

Insert API

func (*PackageRecord) Validate added in v0.1.7

func (r *PackageRecord) Validate() error

Validate implementation of PackageRecord

type Packages added in v0.1.7

type Packages struct {
	PACKAGE_ID int64  `json:"package_id"`
	NAME       string `json:"name" validate:"required"`
	VERSION    string `json:"version" validate:"required"`
	CREATE_AT  int64  `json:"create_at"`
	CREATE_BY  string `json:"create_by"`
	MODIFY_AT  int64  `json:"modify_at"`
	MODIFY_BY  string `json:"modify_by"`
}

Packages represents Packages DBS DB table

func (*Packages) Delete added in v0.1.8

func (r *Packages) Delete(tx *sql.Tx) error

Delete implementation of Packages

func (*Packages) Insert added in v0.1.7

func (r *Packages) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Packages

func (*Packages) SetDefaults added in v0.1.7

func (r *Packages) SetDefaults()

SetDefaults implements set defaults for Packages

func (*Packages) Update added in v0.1.7

func (r *Packages) Update(tx *sql.Tx) error

Update implementation of Packages

func (*Packages) Validate added in v0.1.7

func (r *Packages) Validate() error

Validate implementation of Packages

type ParentRecord added in v0.0.4

type ParentRecord struct {
	Parent string `json:"parent" validate:"required"`
	Did    string `json:"did" validate:"required"`
}

ParentRecord represents input parent record from HTTP request

type Parents

type Parents struct {
	PARENT_ID  int64  `json:"parent_id"`
	DATASET_ID int64  `json:"dataset_id"`
	CREATE_AT  int64  `json:"create_at"`
	CREATE_BY  string `json:"create_by"`
	MODIFY_AT  int64  `json:"modify_at"`
	MODIFY_BY  string `json:"modify_by"`
}

Parents represents Parents DBS DB table

func (*Parents) Delete added in v0.1.8

func (r *Parents) Delete(tx *sql.Tx) error

Delete implementation of Parents

func (*Parents) Insert

func (r *Parents) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Parents

func (*Parents) SetDefaults

func (r *Parents) SetDefaults()

SetDefaults implements set defaults for Parents

func (*Parents) Update added in v0.0.3

func (r *Parents) Update(tx *sql.Tx) error

Update implementation of Parents

func (*Parents) Validate

func (r *Parents) Validate() error

Validate implementation of Parents

type Processing

type Processing struct {
	PROCESSING_ID int64  `json:"processing_id"`
	PROCESSING    string `json:"processing" validate:"required"`
	CREATE_AT     int64  `json:"create_at"`
	CREATE_BY     string `json:"create_by"`
	MODIFY_AT     int64  `json:"modify_at"`
	MODIFY_BY     string `json:"modify_by"`
}

Processing represents Processing DBS DB table

func (*Processing) Delete added in v0.1.8

func (r *Processing) Delete(tx *sql.Tx) error

Delete implementation of Processing

func (*Processing) Insert

func (r *Processing) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Processing

func (*Processing) SetDefaults

func (r *Processing) SetDefaults()

SetDefaults implements set defaults for Processing

func (*Processing) Update added in v0.0.3

func (r *Processing) Update(tx *sql.Tx) error

Update implementation of Processing

func (*Processing) Validate

func (r *Processing) Validate() error

Validate implementation of Processing

type ScriptRecord added in v0.1.7

type ScriptRecord struct {
	Name     string `json:"name"`
	Options  string `json:"options"`
	Parent   string `json:"parent_script"`
	OrderIdx int64  `json:"order_idx"`
}

ScriptRecord represents script input data record

func (*ScriptRecord) Insert added in v0.1.7

func (e *ScriptRecord) Insert(tx *sql.Tx) (int64, error)

Insert API

func (*ScriptRecord) Validate added in v0.1.7

func (r *ScriptRecord) Validate() error

Validate implementation of ScriptRecord

type Scripts added in v0.1.7

type Scripts struct {
	SCRIPT_ID        int64  `json:"script_id"`
	NAME             string `json:"name" validate:"required"`
	ORDER_IDX        int64  `json:"order_idx"`
	OPTIONS          string `json:"options"`
	PARENT_SCRIPT_ID int64  `json:"parent_script_id"`
	CREATE_AT        int64  `json:"create_at"`
	CREATE_BY        string `json:"create_by"`
	MODIFY_AT        int64  `json:"modify_at"`
	MODIFY_BY        string `json:"modify_by"`
}

Scripts represents Scripts DBS DB table

func (*Scripts) Delete added in v0.1.8

func (r *Scripts) Delete(tx *sql.Tx) error

Delete implementation of Scripts

func (*Scripts) Insert added in v0.1.7

func (r *Scripts) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Scripts

func (*Scripts) SetDefaults added in v0.1.7

func (r *Scripts) SetDefaults()

SetDefaults implements set defaults for Scripts

func (*Scripts) Update added in v0.1.7

func (r *Scripts) Update(tx *sql.Tx) error

Update implementation of Scripts

func (*Scripts) Validate added in v0.1.7

func (r *Scripts) Validate() error

Validate implementation of Scripts

type Sites

type Sites struct {
	SITE_ID   int64  `json:"site_id"`
	SITE      string `json:"site" validate:"required"`
	CREATE_AT int64  `json:"create_at"`
	CREATE_BY string `json:"create_by"`
	MODIFY_AT int64  `json:"modify_at"`
	MODIFY_BY string `json:"modify_by"`
}

Sites represents Sites DBS DB table

func (*Sites) Delete added in v0.1.8

func (r *Sites) Delete(tx *sql.Tx) error

Delete implementation of Sites

func (*Sites) Insert

func (r *Sites) Insert(tx *sql.Tx) (int64, error)

Insert implementation of Sites

func (*Sites) SetDefaults

func (r *Sites) SetDefaults()

SetDefaults implements set defaults for Sites

func (*Sites) Update added in v0.0.3

func (r *Sites) Update(tx *sql.Tx) error

Update implementation of Sites

func (*Sites) Validate

func (r *Sites) Validate() error

Validate implementation of Sites

Jump to

Keyboard shortcuts

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