Documentation
¶
Index ¶
- Constants
- func AlgorithmFlag(cc *kingpin.CmdClause) *string
- func FilenameFlag(cc *kingpin.CmdClause) *string
- func MustYaml(i interface{}) string
- func SecretNameArg(cc *kingpin.CmdClause) *string
- func StringFlag(s kingpin.Settings, sv *StringValue) *string
- type CommaSeparatedList
- func (k *CommaSeparatedList) Min(min int) *CommaSeparatedList
- func (k *CommaSeparatedList) Name(name string) *CommaSeparatedList
- func (k *CommaSeparatedList) RestrictTo(values ...string) *CommaSeparatedList
- func (k *CommaSeparatedList) Set(input string) error
- func (k *CommaSeparatedList) String() string
- type Command
- type StringValue
- func (c *StringValue) MaxLength(n int) *StringValue
- func (c *StringValue) MinLength(n int) *StringValue
- func (c *StringValue) Name(name string) *StringValue
- func (c *StringValue) Regex(s string) *StringValue
- func (c *StringValue) Set(input string) error
- func (c *StringValue) String() string
- func (c *StringValue) Trimmed() *StringValue
Constants ¶
const (
// ProgName is the name of this program.
ProgName = "biscuit"
)
Variables ¶
This section is empty.
Functions ¶
func AlgorithmFlag ¶
func AlgorithmFlag(cc *kingpin.CmdClause) *string
AlgorithmFlag defines a flag for the algorithm
func FilenameFlag ¶
func FilenameFlag(cc *kingpin.CmdClause) *string
FilenameFlag defines a flag for the filename.
func MustYaml ¶
func MustYaml(i interface{}) string
MustYaml serializes i to a YAML string, or panics if it fails to do so.
func SecretNameArg ¶
func SecretNameArg(cc *kingpin.CmdClause) *string
SecretNameArg defines a flag for the name of the secret.
func StringFlag ¶
func StringFlag(s kingpin.Settings, sv *StringValue) *string
StringFlag sets a StringValue as the target value for a Kingpin flag.
Types ¶
type CommaSeparatedList ¶
type CommaSeparatedList struct { V []string // contains filtered or unexported fields }
CommaSeparatedList is a configurable flag.Value that parses a comma delimited string into a string array.
func (*CommaSeparatedList) Min ¶
func (k *CommaSeparatedList) Min(min int) *CommaSeparatedList
Min applies a minimum length validation to the array.
func (*CommaSeparatedList) Name ¶
func (k *CommaSeparatedList) Name(name string) *CommaSeparatedList
Name allows you to set a name that will be prefixed to error messages.
func (*CommaSeparatedList) RestrictTo ¶
func (k *CommaSeparatedList) RestrictTo(values ...string) *CommaSeparatedList
RestrictTo validates that each element is a member of the provided values.
func (*CommaSeparatedList) Set ¶
func (k *CommaSeparatedList) Set(input string) error
Set is called by the flag parser.
func (*CommaSeparatedList) String ¶
func (k *CommaSeparatedList) String() string
String returns the values joined with a comma.
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
StringValue is a flag.Value supporting various validation behaviors.
func (*StringValue) MaxLength ¶
func (c *StringValue) MaxLength(n int) *StringValue
MaxLength validates that the value is at most length n.
func (*StringValue) MinLength ¶
func (c *StringValue) MinLength(n int) *StringValue
MinLength validates that the value is at least of length n.
func (*StringValue) Name ¶
func (c *StringValue) Name(name string) *StringValue
Name allows you to set a name that will be prefixed to error messages.
func (*StringValue) Regex ¶
func (c *StringValue) Regex(s string) *StringValue
Regex validates that the string satisfies a regular expression.
func (*StringValue) Set ¶
func (c *StringValue) Set(input string) error
Set is called by the flag parser.
func (*StringValue) String ¶
func (c *StringValue) String() string
String returns the current flag value.
func (*StringValue) Trimmed ¶
func (c *StringValue) Trimmed() *StringValue
Trimmed removes whitespace from the value before validation.