Documentation ¶
Index ¶
- Constants
- func AllocatedHugePages(cli Cli) (int, error)
- func GetSudoPrefix(cli Cli) string
- func InitGlobalOptions(cli Cli, opts *GlobalOptions)
- func InstallAgentCtl(cli Cli, agentctlCommitVersion string) error
- func InstallDocker(cli Cli, dockerVersion string) error
- func InstallVPPProbe(cli Cli, vppProbeTagVersion string) error
- func IsAgentctlAvailable(agentctlCommitVersion string, logger io.Writer) (bool, error)
- func IsDockerAvailable(cli Cli) (bool, error)
- func IsVPPProbeAvailable(vppProbeTagVersion string, logger io.Writer) (bool, error)
- func NewConfigCmd(cli Cli) *cobra.Command
- func NewDependencyCmd(cli Cli) *cobra.Command
- func NewDeploymentCmd(cli Cli) *cobra.Command
- func NewManageCmd(cli Cli) *cobra.Command
- func NewRootCmd(cli Cli) *cobra.Command
- func NewStatusCmd(cli Cli) *cobra.Command
- func NewSupportCmd(cli Cli) *cobra.Command
- func NewTraceCmd(cli Cli) *cobra.Command
- func NewVersionCmd() *cobra.Command
- func ResizeHugePages(cli Cli, size uint) error
- type CLI
- func (cli *CLI) AppName() string
- func (cli *CLI) Apply(opt ...CliOption) error
- func (cli *CLI) Client() client.API
- func (cli *CLI) Entities() []Entity
- func (cli *CLI) Err() io.Writer
- func (cli *CLI) Exec(cmd string, args []string, liveOutput bool) (string, string, error)
- func (cli *CLI) GlobalOptions() *GlobalOptions
- func (cli *CLI) In() *streams.In
- func (cli *CLI) Initialize(opts *GlobalOptions) (err error)
- func (cli *CLI) Out() *streams.Out
- type Cli
- type CliOption
- func WithClient(c client.API) CliOption
- func WithCombinedStreams(combined io.Writer) CliOption
- func WithCustomizations(customizations map[string]interface{}) CliOption
- func WithErrorStream(err io.Writer) CliOption
- func WithInputStream(in io.ReadCloser) CliOption
- func WithOutputStream(out io.Writer) CliOption
- func WithStandardStreams() CliOption
- type ConfigCmdOptions
- type Entity
- type EntityFile
- type EntityVar
- type ExecResult
- type ExtraFile
- type GitHubRelease
- type GlobalOptions
- type ManageOptions
- type NetworkInterface
- type StatusOptions
- type SupportCmdOptions
- type TraceCmdOptions
Constants ¶
const ( EnvVarDebug = "SWCTL_DEBUG" EnvVarLogLevel = "SWCTL_LOGLEVEL" )
const (
MissingExternalToolMessageKey = "MissingExternalTool"
)
const (
NonInputVariablePrefix = "noninput_" // used for go templating variables that are not Entity input variables, i.e. temporal range loop variable
)
Variables ¶
This section is empty.
Functions ¶
func AllocatedHugePages ¶
func GetSudoPrefix ¶
func InitGlobalOptions ¶
func InitGlobalOptions(cli Cli, opts *GlobalOptions)
func InstallAgentCtl ¶
func InstallDocker ¶
func InstallVPPProbe ¶
func IsAgentctlAvailable ¶
func IsDockerAvailable ¶
func IsVPPProbeAvailable ¶
func NewConfigCmd ¶
func NewDependencyCmd ¶
func NewDeploymentCmd ¶
func NewManageCmd ¶
func NewStatusCmd ¶
func NewSupportCmd ¶
func NewTraceCmd ¶
func NewVersionCmd ¶
func ResizeHugePages ¶
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI implements Cli interface.
func (*CLI) GlobalOptions ¶
func (cli *CLI) GlobalOptions() *GlobalOptions
func (*CLI) Initialize ¶
func (cli *CLI) Initialize(opts *GlobalOptions) (err error)
type Cli ¶
type Cli interface { Initialize(opts *GlobalOptions) error Apply(...CliOption) error Client() client.API Entities() []Entity GlobalOptions() *GlobalOptions Exec(cmd string, args []string, liveOutput bool) (stdout string, stderr string, err error) AppName() string Out() *streams.Out Err() io.Writer In() *streams.In }
Cli is a client API for CLI application.
type CliOption ¶
CliOption is a function that customizes CLI.
func WithCombinedStreams ¶
WithCombinedStreams uses the same stream for the output and error streams.
func WithCustomizations ¶
WithCustomizations sets the generic customizations of the CLI.
func WithErrorStream ¶
WithErrorStream sets a cli error stream.
func WithInputStream ¶
func WithInputStream(in io.ReadCloser) CliOption
WithInputStream sets a cli input stream.
func WithOutputStream ¶
WithOutputStream sets a cli output stream.
func WithStandardStreams ¶
func WithStandardStreams() CliOption
WithStandardStreams sets a cli in, out and err streams with the standard streams.
type ConfigCmdOptions ¶
func (*ConfigCmdOptions) InstallFlags ¶
func (opts *ConfigCmdOptions) InstallFlags(flagset *pflag.FlagSet)
type Entity ¶
type Entity struct { Origin string `json:"-"` Name string `json:"name"` Plural string `json:"plural"` Description string `json:"description"` Vars []EntityVar `json:"vars"` Config string `json:"config"` Single bool `json:"single"` Files []ExtraFile `json:"files"` }
Entity is a blueprint for an object defined with a config template of related parts.
type EntityFile ¶
type EntityFile struct {
Entities []Entity `json:"entities"`
}
EntityFile is a file containing entities loaded during initialization.
type EntityVar ¶
type EntityVar struct { Index int `json:"-"` Name string `json:"name"` Description string `json:"description"` Value string `json:"default"` Type string `json:"type"` When string `json:"when"` }
EntityVar is a variable of an entity defined with a template to render its value.
type ExecResult ¶
type GitHubRelease ¶
type GlobalOptions ¶
type GlobalOptions struct { Debug bool LogLevel string Color string ComposeFiles []string EntityFiles []string EmbeddedEntityByte []byte }
func (*GlobalOptions) InstallFlags ¶
func (glob *GlobalOptions) InstallFlags(flags *pflag.FlagSet)
type ManageOptions ¶
type ManageOptions struct { Format string Target string Count uint Force bool IdOffset int DryRun bool Vars map[string]string ShowConfig bool Interactive bool OutputFile string }
func (*ManageOptions) InstallFlags ¶
func (opts *ManageOptions) InstallFlags(flagset *pflag.FlagSet)
type NetworkInterface ¶
type NetworkInterface struct { Name string Pci string Description string SwName string Module string // Nil Driver means that device is unbounded and can be used by vpp which choose driver Driver string }
func DumpDevices ¶
func DumpDevices(cli Cli) ([]NetworkInterface, error)
type StatusOptions ¶
func (*StatusOptions) InstallFlags ¶
func (opts *StatusOptions) InstallFlags(flagset *pflag.FlagSet)
type SupportCmdOptions ¶
type SupportCmdOptions struct {
OutputDirectory string
}
type TraceCmdOptions ¶
type TraceCmdOptions struct {
Args []string
}