Documentation
¶
Index ¶
- Constants
- Variables
- func AddParam(name, sqlName string, params map[string]any, conds []string, ...) ([]string, []interface{})
- func CastInt(val interface{}) (int, error)
- func CastInt64(val interface{}) (int64, error)
- func CastString(val interface{}) (string, error)
- func CleanStatement(stm string) string
- func ConvertFloat(val string) string
- func DBOperation(op string, rec DBRecord, data []byte, msg string) error
- func Date() int64
- func DecodeValidatorError(r, err interface{}) error
- func Error(err error, code int, msg, function string) error
- func GetChunks(vals []string, limit int) []string
- func GetID(tx *sql.Tx, table, id, attr string, val ...interface{}) (int64, error)
- func GetRecID(tx *sql.Tx, rec DBRecord, table, id, attr string, val ...interface{}) (int64, error)
- func GetTestData() error
- func HttpClient(tout int) *http.Client
- func IfExist(tx *sql.Tx, table, rid, attr string, val ...interface{}) bool
- func IfExistMulti(tx *sql.Tx, table, rid string, args []string, vals ...interface{}) bool
- func IncrementSequence(tx *sql.Tx, seq string) (int64, error)
- func IncrementSequences(tx *sql.Tx, seq string, n int) ([]int64, error)
- func InsertManyToMany(tx *sql.Tx, tmplName string, args ...interface{}) error
- func LastInsertID(tx *sql.Tx, table, idName string) (int64, error)
- func ListFiles(dir string) []string
- func LoadSQL(owner string) map[string]any
- func LoadTemplateSQL(tmpl string, tmplData map[string]any) (string, error)
- func OperatorValue(arg string) (string, string)
- func ParseRuns(runs []string) ([]string, error)
- func ParseTmpl(tdir, tmpl string, data interface{}) (string, error)
- func PrintSQL(stm string, args []interface{}, msg string)
- func QueryRow(table, id, attr string, val interface{}) (int64, error)
- func ReplaceBinds(stm string) string
- func RunsConditions(runs []string, table string) (string, []string, []interface{}, error)
- func TokenCondition() string
- func TokenGenerator(runs []string, limit int, name string) (string, []string)
- func TokenGeneratorORACLE(runs []string, limit int, name string) (string, []string)
- func TokenGeneratorSQLite(runs []string, name string) (string, []string)
- func UniqueList(input []string) []string
- func WhereClause(stm string, conds []string) string
- type API
- func (a *API) DeleteBucket() error
- func (a *API) DeleteDataset() error
- func (a *API) DeleteEnvironment() error
- func (a *API) DeleteFile() error
- func (a *API) DeleteOsInfo() error
- func (a *API) DeletePackage() error
- func (a *API) DeleteParent() error
- func (a *API) DeleteProcessing() error
- func (a *API) DeleteScript() error
- func (a *API) DeleteSite() error
- func (a *API) GetBucket() error
- func (a *API) GetChild() error
- func (a *API) GetDataset() error
- func (a *API) GetEnvironment() error
- func (a *API) GetFile() error
- func (a *API) GetOsInfo() error
- func (a *API) GetPackage() error
- func (a *API) GetParent() error
- func (a *API) GetParentDID(did string) (string, error)
- func (a *API) GetProcessing() error
- func (a *API) GetProvenance() error
- func (a *API) GetScript() error
- func (a *API) GetSite() error
- func (a *API) InsertBucket() error
- func (a *API) InsertDataset() error
- func (a *API) InsertEnvironment() error
- func (a *API) InsertFile() error
- func (a *API) InsertOsInfo() error
- func (a *API) InsertPackage() error
- func (a *API) InsertParent() error
- func (a *API) InsertProcessing() error
- func (a *API) InsertScript() error
- func (a *API) InsertSite() error
- func (a *API) String() string
- func (a *API) UpdateBucket() error
- func (a *API) UpdateDataset() error
- func (a *API) UpdateEnvironment() error
- func (a *API) UpdateFile() error
- func (a *API) UpdateOsInfo() error
- func (a *API) UpdatePackage() error
- func (a *API) UpdateParent() error
- func (a *API) UpdateProcessing() error
- func (a *API) UpdateScript() error
- func (a *API) UpdateSite() error
- type BucketRecord
- type Buckets
- type DBRecord
- type DBSError
- type DatasetRecord
- type Datasets
- type EnvironmentRecord
- type Environments
- type FileRecord
- type Files
- type OsInfo
- type OsInfoRecord
- type PackageRecord
- type Packages
- type ParentRecord
- type Parents
- type Processing
- type ScriptRecord
- type Scripts
- type Sites
Constants ¶
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 ¶
var ConcurrencyErr = errors.New("concurrency error")
ConcurrencyErr represents generic concurrency error
var ConcurrentBulkBlocks bool
ConcurrentBulkBlocks defines if code should use concurrent bulkblocks API
var ContentTypeErr = errors.New("content-type error")
ContentTypeErr represents generic content-type error
var DB *sql.DB
DB represents sql DB pointer
var DBOWNER string
DBOWNER represents DBS DB owner
var DBSQL map[string]any
DBSQL represents DBS SQL record
var DBTYPE string
DBTYPE represents DBS DB type, e.g. ORACLE or SQLite
var DRYRUN bool
DRYRUN allows to skip query execution and printout DB statements along with passed parameters
var DatabaseErr = errors.New("database error")
DatabaseErr represents generic database error
var FileLumiChunkSize int
FileLumiChunkSize controls chunk size for FileLumi list insertion
var FileLumiInsertMethod string
FileLumiInsertMethod controls which method to use for insertion of FileLumi list
var FileLumiMaxSize int
FileLumiMaxSize controls max size for FileLumi list insertion
var GenericErr = errors.New("dbs error")
GenericErr represents generic dbs error
var InvalidParamErr = errors.New("invalid parameter(s)")
InvalidParamErr represents generic error for invalid input parameter
var InvalidRequestErr = errors.New("invalid request error")
InvalidRequestErr represents generic invalid request error
var NotImplementedApiErr = errors.New("not implemented api error")
NotImplementedApiErr represents generic not implemented api error
var RecordErr = errors.New("record error")
RecordErr represents generic record error
var RecordValidator *validator.Validate
RecordValidator pointer to validator Validate method
var StaticDir string
StaticDir provides location of static directory
var Timeout int
Timeout represents DBS timeout used by HttpClient
var ValidationErr = errors.New("validation error")
ValidationErr represents generic validation error
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 CastString ¶
CastString function to check and cast interface{} to string data-type
func CleanStatement ¶
CleanStatement cleans the given SQL statement to remove empty strings, etc.
func ConvertFloat ¶
ConvertFloat converts string representation of float scientific number to string int
func DBOperation ¶ added in v0.1.8
DBOperation performs transactional operation in database for provided record
func DecodeValidatorError ¶
func DecodeValidatorError(r, err interface{}) error
DecodeValidatorError provides uniform error representation of DBRecord validation errors
func GetRecID ¶
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 ¶
HttpClient is HTTP client for urlfetch server
func IfExistMulti ¶
IfExistMulti checks if given rid exists in given table for provided value conditions
func IncrementSequence ¶
IncrementSequence API returns single unique ID for a given sequence
func IncrementSequences ¶
IncrementSequences API provide a way to get N unique IDs for given sequence name
func InsertManyToMany ¶ added in v0.1.7
InsertManyToMany provides function to insert many-to-many relationship from given template name and set of parameters
func LastInsertID ¶
LastInsertID returns last insert id of given table and idname parameter
func LoadTemplateSQL ¶
LoadTemplateSQL function loads DBS SQL templated statements
func OperatorValue ¶
OperatorValue function generates operator and value pair for a given argument
func ReplaceBinds ¶
ReplaceBinds replaces given pattern in string
func RunsConditions ¶
RunsConditions function to handle runs conditions
func TokenCondition ¶
func TokenCondition() string
TokenCondition provides proper condition statement for TokenGenerator
func TokenGenerator ¶
TokenGenerator creates a SQL token generator statement
func TokenGeneratorORACLE ¶
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 ¶
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
UniqueList removes duplicates from a slice and returns a new slice with unique elements.
func WhereClause ¶
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 ¶
DeleteBucket deletes bucket record in DB
func (*API) DeleteDataset ¶
func (*API) DeleteEnvironment ¶ added in v0.1.7
DeleteEnvironment deletes environment record in DB
func (*API) DeleteFile ¶
func (*API) DeleteOsInfo ¶ added in v0.1.7
DeleteOsInfo deletes osinfo record in DB
func (*API) DeletePackage ¶ added in v0.1.7
DeletePackage deletes package record in DB
func (*API) DeleteParent ¶
DeleteParent deletes parent record in DB
func (*API) DeleteProcessing ¶
DeleteProcessing deletes processing record in DB
func (*API) DeleteScript ¶ added in v0.1.7
DeleteScript deletes script record in DB
func (*API) GetEnvironment ¶ added in v0.1.7
Environments DBS API
func (*API) GetProvenance ¶ added in v0.1.7
func (*API) InsertBucket ¶
InsertBucket inserts bucket record into DB
func (*API) InsertDataset ¶
InsertDataset inserts dataset into database
func (*API) InsertEnvironment ¶ added in v0.1.7
InsertEnvironment inserts environment record into DB
func (*API) InsertFile ¶
func (*API) InsertOsInfo ¶ added in v0.1.7
InsertOsInfo inserts osinfo record into DB
func (*API) InsertPackage ¶ added in v0.1.7
InsertPackage inserts package record into DB
func (*API) InsertParent ¶
InsertParent inserts parent record into DB
func (*API) InsertProcessing ¶
InsertProcessing inserts processing record into DB
func (*API) InsertScript ¶ added in v0.1.7
InsertScript inserts script record into DB
func (*API) UpdateBucket ¶
UpdateBucket inserts bucket record in DB
func (*API) UpdateDataset ¶
func (*API) UpdateEnvironment ¶ added in v0.1.7
UpdateEnvironment inserts environment record in DB
func (*API) UpdateFile ¶
func (*API) UpdateOsInfo ¶ added in v0.1.7
UpdateOsInfo inserts osinfo record in DB
func (*API) UpdatePackage ¶ added in v0.1.7
UpdatePackage inserts package record in DB
func (*API) UpdateParent ¶
UpdateParent inserts parent record in DB
func (*API) UpdateProcessing ¶
UpdateProcessing inserts processing record in DB
func (*API) UpdateScript ¶ added in v0.1.7
UpdateScript inserts script 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) SetDefaults ¶
func (r *Buckets) SetDefaults()
SetDefaults implements set defaults for 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) ErrorStacktrace ¶
ErrorStacktrace function implements details of DBS error message and stacktrace
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) SetDefaults ¶
func (r *Datasets) SetDefaults()
SetDefaults implements set defaults for 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) SetDefaults ¶
func (r *Files) SetDefaults()
SetDefaults implements set defaults for 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) SetDefaults ¶ added in v0.1.7
func (r *OsInfo) SetDefaults()
SetDefaults implements set defaults for 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
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) SetDefaults ¶ added in v0.1.7
func (r *Packages) SetDefaults()
SetDefaults implements set defaults for 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) SetDefaults ¶
func (r *Parents) SetDefaults()
SetDefaults implements set defaults for 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) SetDefaults ¶ added in v0.1.7
func (r *Scripts) SetDefaults()
SetDefaults implements set defaults for 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) SetDefaults ¶
func (r *Sites) SetDefaults()
SetDefaults implements set defaults for Sites