lib

package
v0.0.0-...-79d4ce4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCmd

func ExecCmd(dir, bin string, args, env []string, cmdOut, cmdErr *bytes.Buffer, verbose bool) error

func GetSubGraph

func GetSubGraph(l, r map[string]*dep.DependencyGraph, a string) (*dep.DependencyGraph, string)

func GetTaskList

func GetTaskList(d *dep.DependencyGraph) []string
func taskSubgraph(g *dep.DependencyGraph, t string) *dep.DependencyGraph {
	if t == "" {
		return g
	}
	fmt.Println("Filtering subgraph fot task", t)
	r := dot.Graph{g.DirectedGraph}.GetNodeByDOTID(t)
	if r == nil {
		log.Fatal("node %s not found in graph with leafs %s", t, g.Leafs())
	}

	//If you add a `func (n dotNode) String() string { return n.DOTID() }` method, then fmt.Sprint(n) or similar with give you the name in the printout.

	// FIXME Check if the task generates some output. If so, let the output node be the target leaf.
	i := g.InduceDir(map[int64]graph.Node{r.ID(): r}, false, true)
	s, ok := i[r.ID()]
	if !ok {
		log.Fatal("subgraph for node %s not found in graph with leafs %s", t, g.Leafs())
	}
	return s
}
func GetTaskListAll(d map[string]*dep.DependencyGraph) [][]string {
	for k, j := range d {
		fmt.Printf("\nSUBGRAPH [for leaf vertex %d]: %+v\n", k, j)
		str := GetTaskList(j, "")
		if str != nil {
			fmt.Println(str)
		}
	}
	return nil
}

func Induce

func Induce(f, o string, args []string)

func InduceSubGraphsFromFile

func InduceSubGraphsFromFile(f string) (map[string]*dep.DependencyGraph, map[string]*dep.DependencyGraph)

func List

func List(f string, args []string)

func PrintGraph

func PrintGraph(g *dep.DependencyGraph)

func ReadFile

func ReadFile(f string) ([]byte, error)

func ReadGraphFromFile

func ReadGraphFromFile(f string) (*dep.DependencyGraph, error)

func WriteGraphToFile

func WriteGraphToFile(f string, g *dep.DependencyGraph) error

Types

type Task

type Task struct {
	ID          int64
	DOTID       string
	Description string
	Cmds        [][]string
	Env         map[string]string
	Sources     map[string]string
	Artifacts   map[string]string
	Results     map[string]string
}

Jump to

Keyboard shortcuts

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