cycle

package
v0.0.0-...-25a1aa9 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Name string
	// contains filtered or unexported fields
}

Endpoint is an endpoint in the graph.

type Graph

type Graph map[string]*Endpoint

Graph is a directed acyclic graph.

func New

func New() Graph

New creates a new directed acyclic graph that can determinate if a stage has dependencies.

func (Graph) Add

func (g Graph) Add(name string, relies ...string) *Endpoint

Add establishes a dependency between two endpoints in the graph.

func (Graph) Ancestors

func (g Graph) Ancestors(name string) []*Endpoint

Ancestors returns the all dependencies of the endpoint.

func (Graph) Dependencies

func (g Graph) Dependencies(name string) []string

Dependencies returns the direct dependencies accounting for skipped dependencies.

func (Graph) DetectCycles

func (g Graph) DetectCycles() bool

DetectCycles returns true if cycles are detected in the graph.

func (Graph) Get

func (g Graph) Get(name string) (*Endpoint, bool)

Get returns the endpoint from the graph.

Jump to

Keyboard shortcuts

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