Documentation
¶
Index ¶
- Variables
- func GetTemplateNamesInDirs(dirs []fs.FS) ([]string, error)
- func LoadTemplates(tmpl *template.Template, role string) error
- func PrepareVars(c *clabcore.CLab) map[string]*NodeConfig
- func RenderAll(allnodes map[string]*NodeConfig) error
- func Send(cs *NodeConfig, _ string, debug bool) error
- type Dict
- type NodeConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugCount int
DebugCount is a debug verbosity counter.
View Source
var TemplateNames []string
TemplateNames is templates to execute.
View Source
var TemplatePaths []string
TemplatePaths is path to additional templates.
Functions ¶
func GetTemplateNamesInDirs ¶
GetTemplateNamesInDirs returns a list of template file names found in a list of dir `paths` without traversing nested dirs template names are following the pattern <some-name>__<role/kind>.tmpl.
func LoadTemplates ¶
LoadTemplates loads templates from all paths for the specific role/kind.
func PrepareVars ¶
func PrepareVars(c *clabcore.CLab) map[string]*NodeConfig
PrepareVars variables for all nodes. This will also prepare all variables for the links.
func RenderAll ¶
func RenderAll(allnodes map[string]*NodeConfig) error
Types ¶
type NodeConfig ¶
type NodeConfig struct {
TargetNode *clabtypes.NodeConfig
Credentials []string // Node's credentials
// All the variables used to render the template
Vars map[string]any
// the Rendered templates
Data []string
Info []string
}
func (*NodeConfig) String ¶
func (c *NodeConfig) String() string
String implements stringer interface for NodeConfig.
Click to show internal directories.
Click to hide internal directories.