Documentation ¶
Overview ¶
Package cli provides common code for building a command line control for the service
Index ¶
- func ReadStdin(filename string) ([]byte, error)
- func WriteFile(filespec string, contents []byte, perms os.FileMode) error
- type Cli
- func (cli *Cli) CryptoProv() *cryptoprov.Crypto
- func (cli *Cli) EnsureCryptoProvider() error
- func (cli *Cli) PopulateControl() error
- func (cli *Cli) PrintCert(key, csrBytes, cert []byte)
- func (cli *Cli) RegisterAction(f func(c ctl.Control, flags interface{}) error, params interface{}) ctl.Action
- func (cli *Cli) Verbose() bool
- func (cli *Cli) WithCryptoProvider(crypto *cryptoprov.Crypto)
- type ReadFileOrStdinFn
- type ReturnCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cli ¶
type Cli struct { *ctl.Ctl ReadFileOrStdin ReadFileOrStdinFn // contains filtered or unexported fields }
Cli is a project specific wrapper to the ctl.Cli struct
func (*Cli) CryptoProv ¶
func (cli *Cli) CryptoProv() *cryptoprov.Crypto
CryptoProv returns crypto provider
func (*Cli) EnsureCryptoProvider ¶
EnsureCryptoProvider is pre-action to load Crypto provider
func (*Cli) PopulateControl ¶ added in v0.4.0
PopulateControl is a pre-action for kingpin library to populate the control object after all the flags are parsed
func (*Cli) RegisterAction ¶
func (cli *Cli) RegisterAction(f func(c ctl.Control, flags interface{}) error, params interface{}) ctl.Action
RegisterAction create new Control action
func (*Cli) WithCryptoProvider ¶ added in v0.4.0
func (cli *Cli) WithCryptoProvider(crypto *cryptoprov.Crypto)
WithCryptoProvider sets custom Crypto Provider
type ReadFileOrStdinFn ¶ added in v0.4.0
ReadFileOrStdinFn allows to read from file or Stdin if the name is "-"
type ReturnCode ¶
type ReturnCode ctl.ReturnCode
ReturnCode is the type that your command returns, these map to standard process return codes
Click to show internal directories.
Click to hide internal directories.