dbs

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
}

func NewLog

func NewLog() *Log

func (*Log) AppendLogContent

func (l *Log) AppendLogContent(ctx kratosx.Context, uuid string, content string) error

AppendLogContent 追加指定的uuid的日志内容

func (*Log) CreateLog

func (l *Log) CreateLog(ctx kratosx.Context, log *entity.Log) (uint32, error)

CreateLog 创建数据

func (*Log) DeleteLog

func (l *Log) DeleteLog(ctx kratosx.Context, id uint32) error

DeleteLog 删除数据

func (*Log) GetLog

func (l *Log) GetLog(ctx kratosx.Context, id uint32) (*entity.Log, error)

GetLog 获取指定的数据

func (*Log) GetLogByUuid

func (l *Log) GetLogByUuid(ctx kratosx.Context, uuid string) (*entity.Log, error)

GetLogByUuid 获取指定的数据

func (*Log) GetLogStatusByUuid

func (l *Log) GetLogStatusByUuid(ctx kratosx.Context, uuid string) (string, error)

GetLogStatusByUuid 获取指定uuid的状态

func (*Log) GetTargetIpByUuid

func (l *Log) GetTargetIpByUuid(ctx kratosx.Context, uuid string) (string, error)

GetTargetIpByUuid 获取指定uuid

func (*Log) ListLog

func (l *Log) ListLog(ctx kratosx.Context, req *types.ListLogRequest) ([]*entity.Log, uint32, error)

ListLog 获取列表

func (*Log) UpdateLog

func (l *Log) UpdateLog(ctx kratosx.Context, log *entity.Log) error

UpdateLog 更新数据

func (*Log) UpdateLogStatus

func (l *Log) UpdateLogStatus(ctx kratosx.Context, uuid string, status string) error

UpdateLogStatus 更新任务状态

type Task

type Task struct {
	// contains filtered or unexported fields
}

func NewTask

func NewTask() *Task

func (*Task) AddCron

func (t *Task) AddCron(id uint32, spec string) error

AddCron 添加定时任务

func (*Task) AllTaskSpecs

func (t *Task) AllTaskSpecs(ctx kratosx.Context) map[uint32]string

AllTaskSpecs 获取当前启用的任务的所有定时时间表达式

func (*Task) CloseCron

func (t *Task) CloseCron()

CloseCron 关闭定时任务

func (*Task) CreateTask

func (t *Task) CreateTask(ctx kratosx.Context, task *entity.Task) (uint32, error)

CreateTask 创建数据

func (*Task) CreateTaskGroup

func (t *Task) CreateTaskGroup(ctx kratosx.Context, tg *entity.TaskGroup) (uint32, error)

CreateTaskGroup 创建数据

func (*Task) DeleteTask

func (t *Task) DeleteTask(ctx kratosx.Context, id uint32) error

DeleteTask 删除数据

func (*Task) DeleteTaskGroup

func (t *Task) DeleteTaskGroup(ctx kratosx.Context, id uint32) error

DeleteTaskGroup 删除数据

func (*Task) GetTask

func (t *Task) GetTask(ctx kratosx.Context, id uint32) (*entity.Task, error)

GetTask 获取指定的数据

func (*Task) GetTaskGroup

func (t *Task) GetTaskGroup(ctx kratosx.Context, id uint32) (*entity.TaskGroup, error)

GetTaskGroup 获取指定的数据

func (*Task) ListTask

func (t *Task) ListTask(ctx kratosx.Context, req *types.ListTaskRequest) ([]*entity.Task, uint32, error)

ListTask 获取列表

func (*Task) ListTaskGroup

func (t *Task) ListTaskGroup(ctx kratosx.Context, req *types.ListTaskGroupRequest) ([]*entity.TaskGroup, uint32, error)

ListTaskGroup 获取列表

func (*Task) RemoveCron

func (t *Task) RemoveCron(id uint32) error

RemoveCron 移除定时任务

func (*Task) StartCron

func (t *Task) StartCron(scheduler func(ctx kratosx.Context, id uint32, spec string, force bool) error)

StartCron 启动定时调度程序

func (*Task) UpdateCron

func (t *Task) UpdateCron(id uint32, spec string) error

UpdateCron 更新定时任务

func (*Task) UpdateTask

func (t *Task) UpdateTask(ctx kratosx.Context, task *entity.Task) error

UpdateTask 更新数据

func (*Task) UpdateTaskGroup

func (t *Task) UpdateTaskGroup(ctx kratosx.Context, tg *entity.TaskGroup) error

UpdateTaskGroup 更新数据

func (*Task) UpdateTaskStatus

func (t *Task) UpdateTaskStatus(ctx kratosx.Context, id uint32, status bool) error

UpdateTaskStatus 更新数据状态

func (*Task) ValidateSpec

func (t *Task) ValidateSpec(s string) error

ValidateSpec 检验定时任务表达式

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker() *Worker

func (*Worker) CheckIP

func (w *Worker) CheckIP(ctx kratosx.Context, req *types.CheckWorkerRequest) error

CheckIP 检查指定的ip是否健康

func (*Worker) CreateWorker

func (w *Worker) CreateWorker(ctx kratosx.Context, worker *entity.Worker) (uint32, error)

CreateWorker 创建数据

func (*Worker) CreateWorkerGroup

func (w *Worker) CreateWorkerGroup(ctx kratosx.Context, wg *entity.WorkerGroup) (uint32, error)

CreateWorkerGroup 创建数据

func (*Worker) DeleteWorker

func (w *Worker) DeleteWorker(ctx kratosx.Context, id uint32) error

DeleteWorker 删除数据

func (*Worker) DeleteWorkerGroup

func (w *Worker) DeleteWorkerGroup(ctx kratosx.Context, id uint32) error

DeleteWorkerGroup 删除数据

func (*Worker) GetWorker

func (w *Worker) GetWorker(ctx kratosx.Context, id uint32) (*entity.Worker, error)

GetWorker 获取指定的数据

func (*Worker) GetWorkerByGroupId

func (w *Worker) GetWorkerByGroupId(ctx kratosx.Context, id uint32) (*entity.Worker, error)

func (*Worker) GetWorkerByIp

func (w *Worker) GetWorkerByIp(ctx kratosx.Context, ip string) (*entity.Worker, error)

GetWorkerByIp 获取指定数据

func (*Worker) GetWorkerGroup

func (w *Worker) GetWorkerGroup(ctx kratosx.Context, id uint32) (*entity.WorkerGroup, error)

GetWorkerGroup 获取指定的数据

func (*Worker) ListWorker

func (w *Worker) ListWorker(ctx kratosx.Context, req *types.ListWorkerRequest) ([]*entity.Worker, uint32, error)

ListWorker 获取列表

func (*Worker) ListWorkerGroup

func (w *Worker) ListWorkerGroup(ctx kratosx.Context, req *types.ListWorkerGroupRequest) ([]*entity.WorkerGroup, uint32, error)

ListWorkerGroup 获取列表

func (*Worker) RegistryCheckIP

func (w *Worker) RegistryCheckIP(ctx kratosx.Context, check func(kratosx.Context, *types.CheckWorkerRequest) error)

RegistryCheckIP 注册监听接收发送的检测信号

func (*Worker) UpdateWorker

func (w *Worker) UpdateWorker(ctx kratosx.Context, worker *entity.Worker) error

UpdateWorker 更新数据

func (*Worker) UpdateWorkerGroup

func (w *Worker) UpdateWorkerGroup(ctx kratosx.Context, wg *entity.WorkerGroup) error

UpdateWorkerGroup 更新数据

func (*Worker) UpdateWorkerStatus

func (w *Worker) UpdateWorkerStatus(ctx kratosx.Context, id uint32, status bool) error

UpdateWorkerStatus 更新数据状态

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL