tasktype

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultExitCode default err code if not get run task code
	DefaultExitCode int = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataAPI

type DataAPI struct {
	URL     string            `json:"url" comment:"URL"`
	Method  string            `json:"method" comment:"Method"`
	PayLoad string            `json:"payload" comment:"PayLoad"`
	Header  map[string]string `json:"header" comment:"Header"`
}

DataAPI http req task

func (DataAPI) Run

func (da DataAPI) Run(ctx context.Context) io.ReadCloser

Run implment TaskRun interface

type DataCode

type DataCode struct {
	Lang     Lang   `json:"lang"`
	LangDesc string `json:"langdesc" comment:"Lang"`
	Code     string `json:"code" comment:"Code"`
}

DataCode run code

func (DataCode) Run

func (ds DataCode) Run(ctx context.Context) io.ReadCloser

Run implment TaskRuner run shell command return io.ReadCloser

type Lang

type Lang uint8

Lang task type lang code

func (Lang) String

func (l Lang) String() string

String return Lanf str

type TaskRuner

type TaskRuner interface {
	Run(ctx context.Context) (out io.ReadCloser)
}

TaskRuner run task interface Please Implment io.ReadCloser reader last 3 byte must be exit code

func GetDataRun

func GetDataRun(t *pb.TaskReq) (TaskRuner, error)

GetDataRun get task type get api or code

Jump to

Keyboard shortcuts

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