graph

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(slice []string, val string) (bool, int)

Find determines if an element exists in the slice

Types

type Graph

type Graph struct {
	ApiVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	FileName   string   `json:"fileName"`
	Resources  []*Graph `json:"resources"`
	Patches    map[int]*Graph
}

Graph represents a node that is a customization file or resource file

func BuildGraph

func BuildGraph(ctx file.Context, rootPath string) (*Graph, error)

BuildGraph recursively explores the specified directory, builds a dependency tree, and returns it

func BuildGraphFromDir

func BuildGraphFromDir(ctx file.Context, rootPath string, directoryPath string, kustomizationFile file.KustomizationFile, parentNodesPtr *map[string]*Graph, childNodesPtr *map[string]*Graph, resourceNodesPtr *map[string]*Graph, patchID *int) (*Graph, error)

BuildGraphFromDir builds and returns a dependency tree from a kustomization file under the specified directory

func NewGraph

func NewGraph(
	apiVersion string,
	kind string,
	fileName string,
	resources []*Graph,
	patches map[int]*Graph,
) *Graph

NewGraph is Graph constructor

func (*Graph) Marshal

func (g *Graph) Marshal() ([]byte, error)

Marshal converts to json

func (*Graph) ToTree

func (g *Graph) ToTree()

ToTree displays a tree structure

Jump to

Keyboard shortcuts

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