cmdutil

package
v0.0.0-...-ebe7275 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-2-Clause-Patent Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogger

func ConfigureLogger(logIn logging.Logger, cfg LogConfig) error

ConfigureLogger configures the logger according to the requested config.

func OutputJSON

func OutputJSON(writer io.Writer, in interface{}, inErr error) error

OutputJSON writes the given data or error to the given writer as JSON.

Types

type ArgsHandler

type ArgsHandler interface {
	CheckArgs([]string) error
	HandleArgs([]string) error
}

type ConfGenCmd

type ConfGenCmd struct {
	MgmtSvcReplicas string `` /* 154-byte string literal not displayed */
	NrEngines       int    `` /* 225-byte string literal not displayed */
	SCMOnly         bool   `short:"s" long:"scm-only" description:"Create a SCM-only config without NVMe SSDs."`
	NetClass        string `` /* 139-byte string literal not displayed */
	NetProvider     string `short:"p" long:"net-provider" description:"Set the network fabric provider to be used"`
	UseTmpfsSCM     bool   `short:"t" long:"use-tmpfs-scm" description:"Use tmpfs for scm rather than PMem"`
	ExtMetadataPath string `` /* 193-byte string literal not displayed */
	FabricPorts     string `` /* 172-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ConfGenCmd) CheckDeprecated

func (cmd *ConfGenCmd) CheckDeprecated(log logging.Logger)

CheckDeprecated will check for deprecated parameters and update as needed.

type DumpTopologyCmd

type DumpTopologyCmd struct {
	JSONOutputCmd
	LogCmd
	Output string `short:"o" long:"output" default:"stdout" description:"Dump output to this location"`
}

DumpTopologyCmd implements a go-flags Commander that dumps the system topology to stdout or to a file.

func (*DumpTopologyCmd) Execute

func (cmd *DumpTopologyCmd) Execute(_ []string) error

type JSONOutputCmd

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

JSONOutputCmd is a struct that implements JSONOutputter and can be embedded in a command struct to provide JSON output.

func (*JSONOutputCmd) EnableJSONOutput

func (cmd *JSONOutputCmd) EnableJSONOutput(writer io.Writer, wroteJSON *atm.Bool)

EnableJSONOutput enables JSON output to the given writer. The wroteJSON parameter is optional and is used to track whether JSON has been written to the writer.

func (*JSONOutputCmd) JSONOutputEnabled

func (cmd *JSONOutputCmd) JSONOutputEnabled() bool

JSONOutputEnabled returns true if JSON output is enabled.

func (*JSONOutputCmd) OutputJSON

func (cmd *JSONOutputCmd) OutputJSON(in interface{}, err error) error

OutputJSON writes the given data or error to the command's writer as JSON.

type JSONOutputter

type JSONOutputter interface {
	EnableJSONOutput(io.Writer, *atm.Bool)
	JSONOutputEnabled() bool
	OutputJSON(interface{}, error) error
}

JSONOutputter is an interface for commands that can output JSON.

type LogCmd

type LogCmd struct {
	logging.Logger
}

LogCmd is an embeddable type that extends a command with logging capabilities.

func (*LogCmd) LogCtx

func (cmd *LogCmd) LogCtx() (context.Context, error)

LogCtx returns a context with the command's logger set.

func (*LogCmd) MustLogCtx

func (cmd *LogCmd) MustLogCtx() context.Context

MustLogCtx returns a context with the command's logger set. NB: Panics on error.

func (*LogCmd) SetLog

func (cmd *LogCmd) SetLog(log logging.Logger)

SetLog sets the logger for the command.

type LogConfig

type LogConfig struct {
	LogFile  string
	LogLevel common.ControlLogLevel
	JSON     bool
}

LogConfig contains parameters used to configure the logger.

type LogSetter

type LogSetter interface {
	SetLog(log logging.Logger)
}

LogSetter defines an interface to be implemented by types that can set a logger.

type ManCmd

type ManCmd struct {
	Output string `long:"output" short:"o" description:"output file"`
	// contains filtered or unexported fields
}

ManCmd defines a go-flags subcommand handler for generating a manpage.

func (*ManCmd) Execute

func (cmd *ManCmd) Execute(_ []string) error

func (*ManCmd) SetWriteFunc

func (cmd *ManCmd) SetWriteFunc(fn func(io.Writer))

type ManPageWriter

type ManPageWriter interface {
	SetWriteFunc(func(io.Writer))
}

ManPageWriter defines an interface to be implemented by commands that write a man page.

type NoArgsCmd

type NoArgsCmd struct{}

NoArgsCmd defines an embeddable struct that can be used to implement a command that does not take any arguments.

func (*NoArgsCmd) CheckArgs

func (cmd *NoArgsCmd) CheckArgs(args []string) error

func (*NoArgsCmd) HandleArgs

func (cmd *NoArgsCmd) HandleArgs(args []string) error

Jump to

Keyboard shortcuts

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