Documentation
¶
Overview ¶
Package cmd contains common flags and routines for all CLIs.
Index ¶
- Variables
- func GetEnvelopeMediaType(sigFormat string) (string, error)
- func GetExpiry(expiry time.Duration) time.Time
- func GetSigner(opts *SignerFlagOpts) (notation.Signer, error)
- func ParseFlagPluginConfig(config string) (map[string]string, error)
- func ParseKeyValueListFlag(val string) (map[string]string, error)
- type KeyValueSlice
- type SignerFlagOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PflagKey = &pflag.Flag{ Name: "key", Shorthand: "k", Usage: "signing key name", } SetPflagKey = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagKey.Name, PflagKey.Shorthand, "", PflagKey.Usage) } PflagKeyFile = &pflag.Flag{ Name: "key-file", Usage: "signing key file", } SetPflagKeyFile = func(fs *pflag.FlagSet, p *string) { fs.StringVar(p, PflagKeyFile.Name, "", PflagKeyFile.Usage) } PflagCertFile = &pflag.Flag{ Name: "cert-file", Usage: "signing certificate file", } SetPflagCertFile = func(fs *pflag.FlagSet, p *string) { fs.StringVar(p, PflagCertFile.Name, "", PflagCertFile.Usage) } PflagEnvelopeType = &pflag.Flag{ Name: "envelope-type", Usage: "signature envelope format, options: 'jws', 'cose'", } SetPflagSignatureFormat = func(fs *pflag.FlagSet, p *string) { fs.StringVar(p, PflagEnvelopeType.Name, envelope.JWS, PflagEnvelopeType.Usage) } PflagTimestamp = &pflag.Flag{ Name: "timestamp", Shorthand: "t", Usage: "timestamp the signed signature via the remote TSA", } SetPflagTimestamp = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagTimestamp.Name, PflagTimestamp.Shorthand, "", PflagTimestamp.Usage) } PflagExpiry = &pflag.Flag{ Name: "expiry", Shorthand: "e", Usage: "expire duration", } SetPflagExpiry = func(fs *pflag.FlagSet, p *time.Duration) { fs.DurationVarP(p, PflagExpiry.Name, PflagExpiry.Shorthand, time.Duration(0), PflagExpiry.Usage) } PflagReference = &pflag.Flag{ Name: "reference", Shorthand: "r", Usage: "original reference", } SetPflagReference = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagReference.Name, PflagReference.Shorthand, "", PflagReference.Usage) } PflagPluginConfig = &pflag.Flag{ Name: "pluginConfig", Shorthand: "c", Usage: "list of comma-separated {key}={value} pairs that are passed as is to the plugin, refer plugin documentation to set appropriate values", } SetPflagPluginConfig = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagPluginConfig.Name, PflagPluginConfig.Shorthand, "", PflagPluginConfig.Usage) } )
Functions ¶
func GetEnvelopeMediaType ¶
Types ¶
type KeyValueSlice ¶
KeyValueSlice is a flag with type int
type SignerFlagOpts ¶
SignerFlagOpts cmd opts for using cmd.GetSigner
func (*SignerFlagOpts) ApplyFlags ¶
func (opts *SignerFlagOpts) ApplyFlags(fs *pflag.FlagSet)
ApplyFlags set flags and their default values for the FlagSet
Click to show internal directories.
Click to hide internal directories.