shared

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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

Min applies a minimum length validation to the array.

func (*CommaSeparatedList) Name

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 Command

type Command interface {
	Run() error
}

Command types have a Run() method.

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.

Jump to

Keyboard shortcuts

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