store
package v1.5.2
Go to latest Published: Dec 20, 2025 License:GPL-3.0
Opens a new window with list of versions in this module.
Latest LatestThis package is not in the latest version of its module.
Opens a new window with license information.
Imports:16 Opens a new window with list of imports.
Imported by:0 Opens a new window with list of known importers.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
This section is empty.
Variables¶
View Source
var (// Db is the main databse connectionDb *gorm.DBDbx *sqlx.DBConndatabase.Connection// DropAll signifies to drop all tables and recreate themDropAll =false)
View Source
var Store =cmap.New[*Execution]()Functions¶
funcGetMachineID¶added inv1.2.15
func GetMachineID()string
funcStoreSetPipelineExec¶added inv1.4.7
funcStoreSetReplicationExec¶added inv1.4.7
func StoreSetReplicationExec(t *sling.TaskExecution)
Store saves the task into the local sqlite
funcToConfigObject¶
func ToConfigObject(t *sling.TaskExecution) (task *Task, replication *Replication)
Types¶
typeExecution¶
type Execution struct {// ID auto-incrementsIDint64 `json:"id,omitempty" gorm:"primaryKey"`ExecIDstring `json:"exec_id,omitempty" gorm:"index"`// StreamID represents the stream inside the replication that is running.// Is an MD5 construct:`md5(Source, Target, Stream, Object)`.StreamIDstring `json:"stream_id,omitempty" sql:"not null" gorm:"index"`// ConfigMD5 points to config table. not nullTaskMD5string `json:"task_md5,omitempty" sql:"not null" gorm:"index"`ReplicationMD5string `json:"replication_md5,omitempty" sql:"not null" gorm:"index"`Statussling.ExecStatus `json:"status,omitempty" gorm:"index"`Err *string `json:"error,omitempty"`StartTime *time.Time `json:"start_time,omitempty" gorm:"index"`EndTime *time.Time `json:"end_time,omitempty" gorm:"index"`Bytesuint64 `json:"bytes,omitempty"`ExitCodeint `json:"exit_code,omitempty"`Outputstring `json:"output,omitempty" sql:"default ''"`Rowsuint64 `json:"rows,omitempty"`Pidint `json:"pid,omitempty"`Versionstring `json:"version,omitempty"`// ProjectID represents the project or the repository.// If .git exists, grab first commit with `git rev-list --max-parents=0 HEAD`.// if not, use md5 of path of folder. Can be `null` if using task.ProjectID *string `json:"project_id,omitempty" gorm:"index"`// FilePath represents the path to a file.// We would need this to refer back to the same file, even if// the contents change. So this should just be the relative path// of the replication.yaml or task.yaml from the root of the project.// If Ad-hoc from CLI flags, let it be `null`.FilePath *string `json:"file_path,omitempty" gorm:"index"`// WorkPath is where the sling process ran fromWorkPath *string `json:"work_path,omitempty"`CreatedDttime.Time `json:"created_dt,omitempty" gorm:"autoCreateTime"`UpdatedDttime.Time `json:"updated_dt,omitempty" gorm:"autoUpdateTime"`Task *Task `json:"task,omitempty" gorm:"-"`Replication *Replication `json:"replication,omitempty" gorm:"-"`TaskExec *sling.TaskExecution `json:"-" gorm:"-"`}Execution is a task execute in the store. PK = exec_id + stream_id
funcToExecutionObject¶
func ToExecutionObject(t *sling.TaskExecution) *Execution
Store saves the task into the local sqlite
typeReplication¶
type Replication struct {Namestring `json:"name" gorm:"index"`ProjectID *string `json:"project_id,omitempty" gorm:"index"`// MD5 is MD5 of Config json stringMD5string `json:"md5" gorm:"primaryKey"`Typesling.JobType `json:"type" gorm:"index"`Configstring `json:"config"`// Original configID *string `json:"id" gorm:"index"`CreatedDttime.Time `json:"created_dt" gorm:"autoCreateTime"`UpdatedDttime.Time `json:"updated_dt" gorm:"autoUpdateTime"`}func (*Replication)Scan¶added inv1.2.10
func (r *Replication) Scan(value interface{})error
Scan scan value into Jsonb, implements sql.Scanner interface
typeTask¶
type Task struct {ProjectID *string `json:"project_id,omitempty" gorm:"index"`// MD5 is MD5 of Config json stringMD5string `json:"md5" gorm:"primaryKey"`Typesling.JobType `json:"type" gorm:"index"`Configsling.Config `json:"config"`CreatedDttime.Time `json:"created_dt" gorm:"autoCreateTime"`UpdatedDttime.Time `json:"updated_dt" gorm:"autoUpdateTime"`} Click to show internal directories.
Click to hide internal directories.