Documentation ¶
Index ¶
- func Migrate(db *gorm.DB) error
- func SqlError2Error(err error) error
- type Entity
- func (e *Entity) DeleteChunkSegment(ctx context.Context, segID int64) error
- func (e *Entity) DeleteFinishedScheduledTask(ctx context.Context, aliveTime time.Duration) error
- func (e *Entity) DeleteObject(ctx context.Context, srcObj, obj *types.Object) error
- func (e *Entity) DeletePluginRecord(ctx context.Context, plugin types.PlugScope, rid string) error
- func (e *Entity) DeleteWorkflow(ctx context.Context, wfID string) error
- func (e *Entity) DeleteWorkflowJob(ctx context.Context, wfJobID ...string) error
- func (e *Entity) GetLabels(ctx context.Context, refType string, refID int64) (*types.Labels, error)
- func (e *Entity) GetObjectByID(ctx context.Context, oid int64) (*types.Object, error)
- func (e *Entity) GetObjectExtendData(ctx context.Context, obj *types.Object) error
- func (e *Entity) GetPluginRecord(ctx context.Context, plugin types.PlugScope, rid string, record interface{}) error
- func (e *Entity) GetWorkflow(ctx context.Context, wfID string) (*types.WorkflowSpec, error)
- func (e *Entity) InsertChunkSegment(ctx context.Context, seg types.ChunkSeg) (*types.Object, error)
- func (e *Entity) ListChunkSegments(ctx context.Context, oid, chunkID int64, allChunk bool) ([]types.ChunkSeg, error)
- func (e *Entity) ListObjectChildren(ctx context.Context, filter types.Filter) ([]*types.Object, error)
- func (e *Entity) ListPluginRecords(ctx context.Context, plugin types.PlugScope, groupId string) ([]string, error)
- func (e *Entity) ListScheduledTask(ctx context.Context, taskID string, filter types.ScheduledTaskFilter) ([]*types.ScheduledTask, error)
- func (e *Entity) ListWorkflow(ctx context.Context) ([]*types.WorkflowSpec, error)
- func (e *Entity) ListWorkflowJob(ctx context.Context, filter types.JobFilter) ([]*types.WorkflowJob, error)
- func (e *Entity) NextSegmentID(ctx context.Context) (nextID int64, err error)
- func (e *Entity) SaveChangeParentObject(ctx context.Context, srcParent, dstParent, obj *types.Object, ...) error
- func (e *Entity) SaveMirroredObject(ctx context.Context, srcObj, dstParent, object *types.Object) error
- func (e *Entity) SaveObjects(ctx context.Context, objects ...*types.Object) error
- func (e *Entity) SavePluginRecord(ctx context.Context, plugin types.PlugScope, groupId, rid string, ...) error
- func (e *Entity) SaveScheduledTask(ctx context.Context, task *types.ScheduledTask) error
- func (e *Entity) SaveWorkflow(ctx context.Context, wf *types.WorkflowSpec) error
- func (e *Entity) SaveWorkflowJob(ctx context.Context, job *types.WorkflowJob) error
- func (e *Entity) SystemInfo(ctx context.Context) (*types.SystemInfo, error)
- type Label
- type Logger
- func (l *Logger) Error(ctx context.Context, s string, i ...interface{})
- func (l *Logger) Info(ctx context.Context, s string, i ...interface{})
- func (l *Logger) LogMode(level glogger.LogLevel) glogger.Interface
- func (l *Logger) Trace(ctx context.Context, begin time.Time, ...)
- func (l *Logger) Warn(ctx context.Context, s string, i ...interface{})
- type Notification
- type Object
- type ObjectChunk
- type ObjectExtend
- type ObjectProperty
- type PluginData
- type ScheduledTask
- type SystemInfo
- type Workflow
- type WorkflowJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SqlError2Error ¶
Types ¶
type Entity ¶
func (*Entity) DeleteChunkSegment ¶
func (*Entity) DeleteFinishedScheduledTask ¶
func (*Entity) DeleteObject ¶
func (*Entity) DeletePluginRecord ¶
func (*Entity) DeleteWorkflow ¶
func (*Entity) DeleteWorkflowJob ¶
func (*Entity) GetObjectByID ¶
func (*Entity) GetObjectExtendData ¶
func (*Entity) GetPluginRecord ¶
func (*Entity) GetWorkflow ¶
func (*Entity) InsertChunkSegment ¶
func (*Entity) ListChunkSegments ¶
func (*Entity) ListObjectChildren ¶
func (*Entity) ListPluginRecords ¶
func (*Entity) ListScheduledTask ¶
func (e *Entity) ListScheduledTask(ctx context.Context, taskID string, filter types.ScheduledTaskFilter) ([]*types.ScheduledTask, error)
func (*Entity) ListWorkflow ¶
func (*Entity) ListWorkflowJob ¶
func (*Entity) NextSegmentID ¶
func (*Entity) SaveChangeParentObject ¶
func (*Entity) SaveMirroredObject ¶
func (*Entity) SaveObjects ¶
func (*Entity) SavePluginRecord ¶
func (*Entity) SaveScheduledTask ¶
func (*Entity) SaveWorkflow ¶
func (*Entity) SaveWorkflowJob ¶
func (*Entity) SystemInfo ¶
type Label ¶
type Label struct { ID int64 `gorm:"column:id;autoIncrement"` RefID int64 `gorm:"column:ref_id;index:label_refid"` RefType string `gorm:"column:ref_type;index:label_reftype"` Key string `gorm:"column:key"` Value string `gorm:"column:value"` SearchKey string `gorm:"column:search_key;index:label_search_key"` }
type Logger ¶
type Logger struct {
*zap.SugaredLogger
}
func NewDbLogger ¶
func NewDbLogger() *Logger
type Notification ¶
type Notification struct { ID string `gorm:"column:id;primaryKey"` Title string `gorm:"column:title"` Message string `gorm:"column:message"` Type string `gorm:"column:type"` Source string `gorm:"column:source"` Action string `gorm:"column:action"` Status string `gorm:"column:status"` Time time.Time `gorm:"column:time;index:notif_time"` }
func (*Notification) TableName ¶
func (o *Notification) TableName() string
type Object ¶
type Object struct { ID int64 `gorm:"column:id;primaryKey"` Name string `gorm:"column:name;index:obj_name"` Aliases string `gorm:"column:aliases"` ParentID int64 `gorm:"column:parent_id;index:parent_id"` RefID int64 `gorm:"column:ref_id;index:ref_id"` RefCount int `gorm:"column:ref_count"` Kind string `gorm:"column:kind"` Hash string `gorm:"column:hash"` Size int64 `gorm:"column:size"` Dev int64 `gorm:"column:dev"` Owner int64 `gorm:"column:owner"` GroupOwner int64 `gorm:"column:group_owner"` Permission int64 `gorm:"column:permission"` Storage string `gorm:"column:storage"` Namespace string `gorm:"column:namespace;index:obj_ns"` CreatedAt int64 `gorm:"column:created_at"` ChangedAt int64 `gorm:"column:changed_at"` ModifiedAt int64 `gorm:"column:modified_at"` AccessAt int64 `gorm:"column:access_at"` }
type ObjectChunk ¶
type ObjectChunk struct { ID int64 `gorm:"column:id;primaryKey"` OID int64 `gorm:"column:oid;index:ck_oid"` ChunkID int64 `gorm:"column:chunk_id;index:ck_id"` Off int64 `gorm:"column:off"` Len int64 `gorm:"column:len"` State int16 `gorm:"column:state"` AppendAt int64 `gorm:"column:append_at;index:ck_append_at"` }
func (ObjectChunk) TableName ¶
func (o ObjectChunk) TableName() string
type ObjectExtend ¶
type ObjectExtend struct { ID int64 `gorm:"column:id;primaryKey"` Symlink string `gorm:"column:symlink"` GroupFilter []byte `gorm:"column:group_filter"` PlugScope []byte `gorm:"column:plug_scope"` }
func (*ObjectExtend) TableName ¶
func (o *ObjectExtend) TableName() string
func (*ObjectExtend) ToExtData ¶
func (o *ObjectExtend) ToExtData() types.ExtendData
func (*ObjectExtend) Update ¶
func (o *ObjectExtend) Update(obj *types.Object)
type ObjectProperty ¶
type ObjectProperty struct { ID int64 `gorm:"column:id;autoIncrement"` OID int64 `gorm:"column:oid;index:prop_oid"` Name string `gorm:"column:key;index:prop_name"` Value string `gorm:"column:value"` }
func (ObjectProperty) TableName ¶
func (o ObjectProperty) TableName() string
type PluginData ¶
type PluginData struct { ID int64 `gorm:"column:id;autoIncrement"` PluginName string `gorm:"column:plugin_name;index:plugin_name"` Version string `gorm:"column:version"` Type types.PluginType `gorm:"column:type"` GroupId string `gorm:"column:group_id;index:group_id"` RecordId string `gorm:"column:record_id;index:record_id"` Content string `gorm:"column:content"` }
func (PluginData) TableName ¶
func (d PluginData) TableName() string
type ScheduledTask ¶
type ScheduledTask struct { ID int64 `gorm:"column:id;autoIncrement"` TaskID string `gorm:"column:task_id;index:st_task_id"` RefType string `gorm:"column:ref_type;index:sche_task_reftype"` RefID int64 `gorm:"column:ref_id;index:sche_task_refid"` Status string `gorm:"column:status;index:st_task_status"` Result string `gorm:"column:result"` CreatedTime time.Time `gorm:"column:created_time"` ExecutionTime time.Time `gorm:"column:execution_time"` ExpirationTime time.Time `gorm:"column:expiration_time"` Event string `gorm:"column:event"` }
func (ScheduledTask) TableName ¶
func (d ScheduledTask) TableName() string
type SystemInfo ¶
type SystemInfo struct { FsID string `gorm:"column:fs_id;primaryKey"` ChunkSeg int64 `gorm:"column:chunk_seg"` }
func (SystemInfo) TableName ¶
func (i SystemInfo) TableName() string
type Workflow ¶
type Workflow struct { ID string `gorm:"column:id;primaryKey"` Name string `gorm:"column:name"` Rule string `gorm:"column:rule"` Steps string `gorm:"column:steps"` Enable bool `gorm:"column:enable;index:wf_enable"` CreatedAt time.Time `gorm:"column:created_at;index:wf_creat"` UpdatedAt time.Time `gorm:"column:updated_at"` LastTriggeredAt time.Time `gorm:"column:last_triggered_at"` }
func (*Workflow) ToWorkflowSpec ¶
func (o *Workflow) ToWorkflowSpec() (*types.WorkflowSpec, error)
type WorkflowJob ¶
type WorkflowJob struct { ID string `gorm:"column:id;autoIncrement"` Workflow string `gorm:"column:workflow;index:job_wf_id"` TriggerReason string `gorm:"column:trigger_reason"` TargetEntry int64 `gorm:"column:target_entry;index:job_tgt_en"` Target string `gorm:"column:target"` Steps string `gorm:"column:steps"` Status string `gorm:"column:status;index:job_status"` Message string `gorm:"column:message"` Executor string `gorm:"column:executor;index:job_executor"` StartAt time.Time `gorm:"column:start_at"` FinishAt time.Time `gorm:"column:finish_at"` CreatedAt time.Time `gorm:"column:created_at;index:job_created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` }
func (*WorkflowJob) TableName ¶
func (o *WorkflowJob) TableName() string
func (*WorkflowJob) ToWorkflowJobSpec ¶
func (o *WorkflowJob) ToWorkflowJobSpec() (*types.WorkflowJob, error)
func (*WorkflowJob) Update ¶
func (o *WorkflowJob) Update(job *types.WorkflowJob) error
Click to show internal directories.
Click to hide internal directories.