runner

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIVELOG = 5000
	TIME    = 12
	UNIT    = "hour"
)

Variables

View Source
var (
	UnitMap = map[string]time.Duration{
		"second": time.Second,
		"minute": time.Minute,
		"hour":   time.Hour,
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Config config.Config
	Dag    dag.DAG
	Data   Proto
}

func DefaultConfig

func DefaultConfig() *Config

type File added in v1.20.0

type File struct {
	Content string `json:"content"`
	Gzip    bool   `json:"gzip"`
}

type Metadata

type Metadata struct {
	Name string `json:"name"`
}

type Output added in v1.12.0

type Output struct {
	Pos     int64  `json:"pos"`
	Time    int64  `json:"time"`
	Message string `json:"message"`
}

type Proto

type Proto struct {
	ApiVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	Metadata   Metadata `json:"metadata"`
	Spec       Spec     `json:"spec"`
}

type Result

type Result struct {
	Output Output `json:"output"`
	Error  string `json:"error"`
}

type Runner

type Runner interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) error
	Tail(ctx context.Context) dagRunner.Livelog
	Tasks(ctx context.Context) []Task
}

func New

func New(_ context.Context, cfg *Config) Runner

type Spec

type Spec struct {
	Tasks []Task `json:"tasks"`
}

type Task

type Task struct {
	Name     string   `json:"name"`
	File     File     `json:"file"`
	Commands []string `json:"commands"`
	Depends  []string `json:"depends"`
	Timeout  Timeout  `json:"timeout"`
}

type Timeout added in v1.19.0

type Timeout struct {
	Time int64  `json:"time"`
	Unit string `json:"unit"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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