Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEmptyInput = errors.New("no input to parse")
)
Functions ¶
This section is empty.
Types ¶
type C ¶
type C int
C is a special 'counter' type that tracks the number of times a particular argument is supplied, expecting no value to be supplied - like a boolean flag.
type Counter ¶
type Counter struct{}
Counter is a parser for some C - it tracks how many times the argument was supplied rather than the value supplied.
type I ¶
type I bool
I is a special 'indicator' that acts as a boolean switch that can be supplied multiple times.
type Indicator ¶
type Indicator struct {
Initial bool
}
Indicator is a parser for some I - it flips the value for each time the input is supplied/detected.
type Parser ¶
type Parser[T any] interface { // Parse should attempt to parse a new variable from the given input, returning an informative error on failure Parse(input ...string) (T, error) }
A Parser is responsible for parsing some type T from string input.
Click to show internal directories.
Click to hide internal directories.