Automatic generation of the doc for the CLI flags and env vars.
This commit is contained in:
parent
c39aa5e857
commit
0ee5d3d83f
15 changed files with 1898 additions and 1729 deletions
|
@ -11,6 +11,7 @@ const (
|
|||
TagLabelSliceAsStruct = "label-slice-as-struct"
|
||||
|
||||
// TagDescription is the documentation for the field.
|
||||
// - "-": ignore the field.
|
||||
TagDescription = "description"
|
||||
|
||||
// TagLabelAllowEmpty is related to TagLabel.
|
||||
|
|
|
@ -32,7 +32,7 @@ type Provider struct {
|
|||
Watch bool `description:"Watch provider." json:"watch,omitempty" toml:"watch,omitempty" yaml:"watch,omitempty" export:"true"`
|
||||
Filename string `description:"Override default configuration template. For advanced users :)" json:"filename,omitempty" toml:"filename,omitempty" yaml:"filename,omitempty" export:"true"`
|
||||
DebugLogGeneratedTemplate bool `description:"Enable debug logging of generated configuration template." json:"debugLogGeneratedTemplate,omitempty" toml:"debugLogGeneratedTemplate,omitempty" yaml:"debugLogGeneratedTemplate,omitempty" export:"true"`
|
||||
TraefikFile string `description:"-" json:"traefikFile,omitempty" toml:"traefikFile,omitempty" yaml:"traefikFile,omitempty"`
|
||||
TraefikFile string `description:"-" json:"traefikFile,omitempty" toml:"-" yaml:"-"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
|
|
|
@ -23,19 +23,11 @@ func (d *Duration) Set(s string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Get returns the duration value.
|
||||
func (d *Duration) Get() interface{} { return time.Duration(*d) }
|
||||
|
||||
// String returns a string representation of the duration value.
|
||||
func (d *Duration) String() string { return (*time.Duration)(d).String() }
|
||||
|
||||
// SetValue sets the duration from the given Duration-asserted value.
|
||||
func (d *Duration) SetValue(val interface{}) {
|
||||
*d = val.(Duration)
|
||||
}
|
||||
func (d Duration) String() string { return (time.Duration)(d).String() }
|
||||
|
||||
// MarshalText serialize the given duration value into a text.
|
||||
func (d *Duration) MarshalText() ([]byte, error) {
|
||||
func (d Duration) MarshalText() ([]byte, error) {
|
||||
return []byte(d.String()), nil
|
||||
}
|
||||
|
||||
|
@ -46,8 +38,8 @@ func (d *Duration) UnmarshalText(text []byte) error {
|
|||
}
|
||||
|
||||
// MarshalJSON serializes the given duration value.
|
||||
func (d *Duration) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(time.Duration(*d))
|
||||
func (d Duration) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(time.Duration(d))
|
||||
}
|
||||
|
||||
// UnmarshalJSON deserializes the given text into a duration value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue