Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Log *clog.Log
Log is the one and only logger for the application. nolint
Functions ¶
func Run ¶
func Run(cliStructReference interface{}, options RunOptions)
Run is the main entry point if no custom arguments are needed.
func RunWithArguments ¶
func RunWithArguments(cliStructReference interface{}, options RunOptions, customArgs ...interface{})
RunWithArguments is the main entry point when there are custom arguments.
Types ¶
type ApplicationType ¶
type ApplicationType = int
ApplicationType specifies the type of the application, e.g. Utility.
const ( // Daemon application type, e.g. can run in the background. Daemon ApplicationType = iota // Utility application type. Utility )
type LogConfigFile ¶
The LogConfigFile struct contains configuration when the log output is a file.
type LogFileString ¶
type LogFileString string
The LogFileString is the name of the log file.
func (LogFileString) AfterApply ¶
func (o LogFileString) AfterApply(log *clog.Log) error
AfterApply hook is called when log file name is set from the command line.
type LogLevelString ¶
type LogLevelString string
The LogLevelString is the log level.
func (LogLevelString) AfterApply ¶
func (o LogLevelString) AfterApply(log *clog.Log) error
AfterApply hook is called when log level is set from the command line.
type Options ¶
type Options struct { LogLevel LogLevelString `help:"the log level"` LogFile LogFileString `help:"log output file" default:""` }
The Options struct is used to configure the log from the command line.
type RunOptions ¶
type RunOptions struct { Version string ApplicationType ApplicationType LogConfig interface{} }
The RunOptions struct contains runtime options.