Documentation
¶
Overview ¶
Package cli holds the pure helpers of the command line: argument parsing and text formatting with no dependency on the server.
Index ¶
- func DialAddress(listen string) string
- func FormatDuration(duration time.Duration) string
- func GeneratePassword() (string, error)
- func ParseKeyFilter(raw string) (string, *string, error)
- func ParseSeverity(raw string) (int, error)
- func ParseTimeBound(raw string, now time.Time) (time.Time, error)
- func ReadPassword(reader io.Reader) (string, error)
- func TailLines(path string, count int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialAddress ¶
DialAddress turns a listen address into one a local client can connect to: wildcard hosts become the loopback address.
func FormatDuration ¶
FormatDuration renders an uptime in the two largest units: 3d4h, 2h13m, 5m10s, 45s.
func GeneratePassword ¶
GeneratePassword returns 24 random URL-safe characters.
func ParseKeyFilter ¶
ParseKeyFilter splits "key" or "key=value". A nil value matches key presence only.
func ParseSeverity ¶
ParseSeverity accepts a level name (debug, info, warn, error, fatal) or its number 0-4.
func ParseTimeBound ¶
ParseTimeBound accepts an RFC 3339 timestamp or an age such as 30m, 6h or 2d, which resolves to now minus that age.
func ReadPassword ¶
ReadPassword reads one password from reader and strips the line ending. An empty result fails.
Types ¶
This section is empty.