Documentation
¶
Index ¶
Constants ¶
const (
ProjectRootPath = "."
)
Variables ¶
var ( ErrCyclicDependency = errors.New("Cyclic dependency detected") ErrDuplicateComponentID = errors.New("Duplicate Component ID") ErrUnknownComponentID = errors.New("Unknown Component ID") )
var (
ErrMissingField = errors.New("Missing content field")
)
Functions ¶
func WithPackagePath ¶
func WithPackagePath(packagePath string) buildOptions
WithPackagePath provides package path configuration.
func WithProjectRoot ¶
func WithProjectRoot(projectRootPath string) buildOptions
WithProjectRoot provides the path to the project root.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
// contains filtered or unexported fields
}
BuildOptions defining which package is compiled and how it is done.
type Builder ¶
type Builder struct {
}
Builder compiles and decodes CUE kubernetes manifest definitions of a component to the corresponding Go struct.
type DependencyGraph ¶
type DependencyGraph struct {
// contains filtered or unexported fields
}
DependencyGraph is an adjacency list which represents the directed acyclic graph of component dependencies. The Dependencies field in the Node struct holds a list of other component ids to which the current component has edges.
func NewDependencyGraph ¶
func NewDependencyGraph() DependencyGraph
func (*DependencyGraph) Delete ¶
func (graph *DependencyGraph) Delete(componentID string)
func (*DependencyGraph) Get ¶
func (graph *DependencyGraph) Get(componentID string) Instance
Get returns the Component if it has been identified by its id. It returns nil if no Node has been found.
func (*DependencyGraph) Insert ¶
func (graph *DependencyGraph) Insert(nodes ...Instance) error
Insert places given Nodes into the DependencyGraph. It returns an error if a given Node id / component id already exists in the graph.
func (*DependencyGraph) TopologicalSort ¶
func (dag *DependencyGraph) TopologicalSort() ([]Instance, error)
TopologicalSort performs a topological sort on the component dependency graph and returns the sorted order. It returns an error if a cycle is detected.
type HelmRelease ¶
type HelmRelease struct {
ID string
Dependencies []string
Content helm.ReleaseDeclaration
}
HelmRelease represents a Declcd component with its id, dependencies and content.. It is the Go equivalent of the CUE definition the user interacts with. See helm.ReleaseDeclaration for more.
func (*HelmRelease) GetDependencies ¶
func (hr *HelmRelease) GetDependencies() []string
func (*HelmRelease) GetID ¶
func (hr *HelmRelease) GetID() string
type Instance ¶
Instance represents a Declcd component with its id, dependencies and content. It is the Go equivalent of the CUE definition the user interacts with. ID is constructed based on the content of the component.
type Manifest ¶
type Manifest struct {
ID string
Dependencies []string
Content unstructured.Unstructured
}
Manifest represents a Declcd component with its id, dependencies and content. It is the Go equivalent of the CUE definition the user interacts with. See unstructured.Unstructured for more.