kapitan

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParameterTypeUnknown = "unknown"
	ParameterTypeString  = "string"
	ParameterTypeNumber  = "number"
	ParameterTypeObject  = "object"
	ParameterTypeList    = "list"
)

Variables

This section is empty.

Functions

func Walk

func Walk(root yaml.Node, fn WalkFunc) error

Walk walks a yaml node, calling fn for each node in the tree, including root.

Types

type Class

type Class struct {
	Path        string      // the class path in the project structure
	Name        string      // the class name
	Description string      // a description for the class (extracted from file header comments)
	Uses        []string    // a slice of classes from which this class inherits
	UsedBy      []string    // a slice of classes that inherit from this class
	Parameters  []Parameter // the parameters of this class
}

Class defines a class in a kapitan project.

func NewClasses

func NewClasses(parsed []*parsed) ([]Class, error)

NewClasses returns a slice of non empty classes from given parsed yaml files.

func (Class) IsEmpty

func (c Class) IsEmpty() bool

IsEmpty returns if this class is suitable to be displayed in the documentation.

type PairedNodes

type PairedNodes struct {
	// contains filtered or unexported fields
}

PairedNodes wraps a pair of nodes (used to get key / value in the context of a MappingNode).

type Parameter

type Parameter struct {
	Key          string        // the key in the yaml
	Kind         ParameterType // the parameter kind
	Description  string        // a description for the parameter (extracted from parameter header comment in the class)
	DefaultValue string        // the parameter default value (the value defined in the class)
}

Parameter defines a kapitan parameter used in a class.

type ParameterType

type ParameterType string

ParameterType defines the type of parameter.

type Project

type Project struct {
	Classes []Class
}

Project describes a kapitan project.

func NewProject

func NewProject(dir string) (*Project, error)

NewProject returns a newly instanciated project initialized from project directory path.

type WalkFunc

type WalkFunc func(path []string, node yaml.Node) error

Jump to

Keyboard shortcuts

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