service

package
v0.0.0-...-9a2ebf3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecTaskReply

type ExecTaskReply struct {
	Type    string `json:"type"`
	Content string `json:"content"`
	Time    uint32 `json:"time"`
}

type ExecTaskReplyFunc

type ExecTaskReplyFunc func(*ExecTaskReply) error

type ExecTaskRequest

type ExecTaskRequest struct {
	Id            uint32
	Uuid          string
	Type          string
	Value         string
	ExpectCode    uint32
	RetryCount    uint32
	RetryWaitTime uint32
	MaxExecTime   uint32
}

type Task

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

func NewTask

func NewTask(config *conf.Config, factory TaskFactory) *Task

func (*Task) CancelExecTask

func (uc *Task) CancelExecTask(uuid string)

func (*Task) ExecTask

func (uc *Task) ExecTask(ctx kratosx.Context, task *ExecTaskRequest, fn ExecTaskReplyFunc) error

type TaskFactory

type TaskFactory interface {
	ExecTask(ctx kratosx.Context, task *ExecTaskRequest, fn ExecTaskReplyFunc) error
	CancelExecTask(uuid string)
}

Jump to

Keyboard shortcuts

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