flags

package
v0.0.0-...-83de85e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFormat

type LogFormat string

LogFormat determines the output format of the log stream

const JSONLogFormat LogFormat = "json"
const KeyValueLogFormat LogFormat = "keyvalue"
const PlainLogFormat LogFormat = "plain"

func (*LogFormat) Set

func (l *LogFormat) Set(value string) error

Set implements pflag.Value

func (*LogFormat) String

func (l *LogFormat) String() string

String implements Stringer

func (*LogFormat) Type

func (l *LogFormat) Type() string

Type implements pflag.Value

type TimeFormat

type TimeFormat string

TimeFormat is a timestamp format string that also accepts the following RFC names as shortcuts

 ANSIC       = "Mon Jan _2 15:04:05 2006"
	UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
	RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
	RFC822      = "02 Jan 06 15:04 MST"
	RFC822Z     = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
	RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
	RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
	RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
	RFC3339     = "2006-01-02T15:04:05Z07:00"
	RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"

Any string is accepted

func (*TimeFormat) Set

func (l *TimeFormat) Set(value string) error

Set implements pflag.Value

func (*TimeFormat) String

func (l *TimeFormat) String() string

String implements Stringer

func (*TimeFormat) Type

func (l *TimeFormat) Type() string

Type implements pflag.Value

type TimestampFlag

type TimestampFlag string

TimestampFlag implements the Value interface to accept and validate a RFC3339 timestamp string as a flag

func (TimestampFlag) AsTime

func (t TimestampFlag) AsTime() time.Time

AsTime returns the underlying time instance

func (*TimestampFlag) Set

func (t *TimestampFlag) Set(value string) error

Set implements pflag.Value

func (*TimestampFlag) String

func (t *TimestampFlag) String() string

String implements Stringer

func (*TimestampFlag) Type

func (t *TimestampFlag) Type() string

Type implements pflag.Value

Jump to

Keyboard shortcuts

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