Movatterモバイル変換


[0]ホーム

URL:


store

package
v1.5.2Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License:GPL-3.0Imports:16Imported by:0

Details

Repository

github.com/slingdata-io/sling-cli

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)

Functions

funcGetMachineIDadded inv1.2.15

func GetMachineID()string

funcInitDB

func InitDB()

InitDB initializes the database

funcStoreSetPipelineExecadded inv1.4.7

func StoreSetPipelineExec(pl *sling.Pipeline)

funcStoreSetReplicationExecadded 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)Scanadded inv1.2.10

func (r *Replication) Scan(value interface{})error

Scan scan value into Jsonb, implements sql.Scanner interface

func (Replication)Valueadded inv1.2.10

func (rReplication) Value() (driver.Value,error)

Value return json value, implement driver.Valuer interface

typeSettingadded inv1.2.15

type Setting struct {Keystring `json:"key" gorm:"primaryKey"`Valuestring `json:"value"`}

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"`}

func (*Task)Scanadded inv1.2.10

func (t *Task) Scan(value interface{})error

Scan scan value into Jsonb, implements sql.Scanner interface

func (Task)Valueadded inv1.2.10

func (tTask) Value() (driver.Value,error)

Value return json value, implement driver.Valuer interface

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp