dag

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0, BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// errors
	NotFound = "not found"
	Root     = "root"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

type DAG[T1 any] interface {
	AddVertex(ctx context.Context, s string, v T1) error
	UpdateVertex(ctx context.Context, s string, v T1) error
	Connect(ctx context.Context, from, to string)
	AddDownEdge(ctx context.Context, from, to string)
	AddUpEdge(ctx context.Context, from, to string)
	VertexExists(s string) bool
	GetVertex(s string) (T1, error)
	GetVertices() map[string]T1
	GetDownVertexes(from string) []string
	GetUpVertexes(from string) []string
	TransitiveReduction(ctx context.Context)
	Print(name string)
	PrintFrom(name, from string)
}

func New

func New[T1 any]() DAG[T1]

type Edge

type Edge struct {
	From string
	To   string
}

used for returning

type WalkConfig

type WalkConfig struct {
	WalkInitFn  WalkInitFn
	WalkEntryFn WalkEntryFn
}

type WalkEntryFn

type WalkEntryFn func(ctx context.Context, from string, depth int)

type WalkInitFn

type WalkInitFn func(ctx context.Context)

Jump to

Keyboard shortcuts

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