dag

package
v0.2.134 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Marshaler = &jsonpb.Marshaler{
	EnumsAsInts:  true,
	EmitDefaults: false,
	OrigName:     true,
}

Functions

func CheckDAG

func CheckDAG(tasks map[string]*Task) error

topological sort 実際遅いけどもういいや O(E^2 + V)

func DoDAG

func DoDAG(ctx context.Context, tasks map[string]*Task, out io.Writer, conn *grpc.ClientConn) bool

出力で時間を出したほうがよさそう

func GetMessageType

func GetMessageType(s string, conn *grpc.ClientConn) (reflect.Type, reflect.Value, bool)

TODO :生成自動化

Types

type ActionResult

type ActionResult struct {
	Name string
	Res  proto.Message
	Err  error
}

type Task

type Task struct {
	Type        string      `yaml:"type"`
	Action      string      `yaml:"action"`
	Args        interface{} `yaml:"args"`
	DependsOn   []string    `yaml:"depends_on"`
	IgnoreError bool        `yaml:"ignore_error"`
	// contains filtered or unexported fields
}

func (Task) Do

func (a Task) Do(conn *grpc.ClientConn) (proto.Message, error)

return response JSON bytes

Jump to

Keyboard shortcuts

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