Documentation ¶
Index ¶
- Constants
- type GetLogRequest
- type ListLogRequest
- type Log
- type Repo
- type UseCase
- func (u *UseCase) CreateLog(ctx kratosx.Context, req *Log) (uint32, error)
- func (u *UseCase) DeleteLog(ctx kratosx.Context, ids []uint32) (uint32, error)
- func (u *UseCase) GetLog(ctx kratosx.Context, req *GetLogRequest) (*Log, error)
- func (u *UseCase) ListLog(ctx kratosx.Context, req *ListLogRequest) ([]*Log, uint32, error)
Constants ¶
View Source
const ( ExecRunning = "running" ExecFail = "fail" ExecCancel = "cancel" ExecSuccess = "success" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetLogRequest ¶
type GetLogRequest struct {
Id *uint32 `json:"id"`
}
type ListLogRequest ¶
type Log ¶
type Log struct { Id uint32 `json:"id"` Uuid string `json:"uuid"` WorkerId uint32 `json:"workerId"` WorkerSnapshot string `json:"workerSnapshot"` TaskId uint32 `json:"taskId"` TaskSnapshot string `json:"taskSnapshot"` StartAt int64 `json:"startAt"` EndAt int64 `json:"endAt"` Content string `json:"content"` Status string `json:"status"` }
type Repo ¶
type Repo interface { // GetLog 获取指定的日志信息 GetLog(ctx kratosx.Context, id uint32) (*Log, error) // ListLog 获取日志信息列表 ListLog(ctx kratosx.Context, req *ListLogRequest) ([]*Log, uint32, error) // CreateLog 创建日志信息 CreateLog(ctx kratosx.Context, req *Log) (uint32, error) // DeleteLog 删除日志信息 DeleteLog(ctx kratosx.Context, ids []uint32) (uint32, error) // IsRunning 任务是否还在执行 IsRunning(ctx kratosx.Context, uuid string) bool // AppendLogContent 追加日志内容 AppendLogContent(ctx kratosx.Context, uuid string, c string) error // UpdateLogStatus 更新日志状态 UpdateLogStatus(ctx kratosx.Context, uuid string, err error) error // CancelTaskByUUID 取消任务通过uuid CancelTaskByUUID(ctx kratosx.Context, uuid string) error // GetTargetIpByUuid 获取指定任务的执行节点ip GetTargetIpByUuid(ctx kratosx.Context, uuid string) (string, error) }
Click to show internal directories.
Click to hide internal directories.