app

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

App wide context

Functions

func ConfigTx added in v0.0.3

func ConfigTx(configs map[string]*config.NodeConfig, ctx *helpers.Context) error

Send commands or commit/compare configuration to a single node

func ConfigTx1 added in v0.0.3

func ConfigTx1(c *config.NodeConfig, action tx.Action) ([]*tx.Response, error)

Send commands or commit/compare configuration to a single node

func ConfigTx1PP added in v0.0.12

func ConfigTx1PP(ctx *helpers.Context, act tx.Action, nn string, cfg *config.NodeConfig)

func DiscoverFile

func DiscoverFile(template, infile string) ([]map[string]interface{}, error)

func DiscoverTopo

func DiscoverTopo(templateName string, ctx *helpers.Context) (map[string][]map[string]interface{}, error)

func GetCmdLineParser added in v0.0.3

func GetCmdLineParser(ast interface{}) *kong.Kong

func LoadAndPrep

func LoadAndPrep(nodeFilter *[]string, topoFile string, render bool) (map[string]*config.NodeConfig, error)

Load the topo files and prepare the variables

func Main

func Main()

func RunWebConfig added in v0.0.3

func RunWebConfig(ws chan<- interface{}, cmd string)

func WebConfigDone added in v0.0.8

func WebConfigDone(ws chan<- interface{}, retry int)

Types

type CmdColor

type CmdColor struct {
	Cmd []string `arg:""`
}

func (*CmdColor) Run

func (r *CmdColor) Run(ctx *helpers.Context) error

type CmdConfig

type CmdConfig struct {
	Topo          string   `short:"t" help:"topology file" type:"existingfile" predictor:"topo"`
	TemplatePaths []string `short:"p" help:"paths to search for templates" type:"existingdir" predictor:"dir"`
	TemplateList  []string `short:"l" help:"template names to render"`
	Filter        []string `short:"f" help:"nodes to include" optional:""`

	Commit   struct{} `cmd:"" help:"Commit configuration on the node."`
	Compare  struct{} `cmd:"" help:"Compare rendered templates to the node's config."`
	Send     struct{} `cmd:"" help:"Send commands to the node (i.e. show)"`
	Template struct{} `cmd:"" help:"Show rendered templates."`
	Vars     struct{} `cmd:"" help:"Show variable inputs."`
}

func (*CmdConfig) Run

func (r *CmdConfig) Run(ctx *helpers.Context) error

type CmdServe

type CmdServe struct {
	Topo          string   `short:"t" help:"Topology file" type:"existingfile" predictor:"topo"`
	TemplatePaths []string `short:"p" help:"Paths to search for templates" type:"path" predictor:"dir"`

	Addr string `help:"Serve on addr." default:":8080"`
	Url  string `help:"Serve on a custom URL path" default:"/labctl"`
}

func (*CmdServe) Run

func (r *CmdServe) Run(ctx *helpers.Context) error

type CmdVersion added in v0.0.5

type CmdVersion struct {
	Upgrade bool `short:"u" help:"Upgrade labctl" default:"false"`
}

func (*CmdVersion) Run added in v0.0.5

func (r *CmdVersion) Run(ctx *helpers.Context) error

Jump to

Keyboard shortcuts

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