config

package
v0.0.0-0.15.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: BSD-3-Clause Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateNames []string

templates to execute

View Source
var TemplatePaths []string

path to additional templates

Functions

func GetTemplateNamesInDirs

func GetTemplateNamesInDirs(paths []string) ([]string, error)

GetTemplateNamesInDirs returns a list of template file names found in a dir p without traversing nested dirs template names are following the pattern <some-name>__<kind>.tmpl

func LoadTemplates

func LoadTemplates(tmpl *template.Template, role string) error

Load templates from all paths for the specific role/kind

func PrepareVars

func PrepareVars(nodes map[string]nodes.Node, links map[int]*types.Link) map[string]Dict

Prepare variables for all nodes. This will also prepare all variables for the links

func RenderAll

func RenderAll(nodes map[string]nodes.Node, links map[int]*types.Link) (map[string]*NodeConfig, error)

func SplitTrim

func SplitTrim(s string) []string

Split a string on commas and trim each line

Types

type Dict

type Dict map[string]interface{}

type NodeConfig

type NodeConfig struct {
	TargetNode *types.NodeConfig
	// All the variables used to render the template
	Vars map[string]interface{}
	// the Rendered templates
	Data []string
	Info []string
}

func (*NodeConfig) Print

func (c *NodeConfig) Print(printLines int)

Print the config

func (*NodeConfig) String

func (c *NodeConfig) String() string

Implement stringer for NodeConfig

type NodeSettings

type NodeSettings struct {
	Vars      map[string]string
	Transport string
	Templates []string
}

The new agreed node config

func GetNodeConfig

func GetNodeConfig(labels map[string]string) NodeSettings

Temporary function to extract NodeSettings from the Labels In the next phase node settings will be added to the clab file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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