model

package
v0.17.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 5 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes added in v0.12.0

type Bytes uint64

Bytes is a data type which supports yaml serialization/deserialization with units.

func (*Bytes) MarshalYAML added in v0.12.0

func (b *Bytes) MarshalYAML() (interface{}, error)

func (*Bytes) UnmarshalYAML added in v0.12.0

func (b *Bytes) UnmarshalYAML(unmarshal func(interface{}) error) error

type TimeOrDurationValue

type TimeOrDurationValue struct {
	Time *time.Time
	Dur  *model.Duration
}

TimeOrDurationValue is a custom kingping parser for time in RFC3339 or duration in Go's duration format, such as "300ms", "-1.5h" or "2h45m". Only one will be set.

func TimeOrDuration

func TimeOrDuration(flags *kingpin.FlagClause) *TimeOrDurationValue

TimeOrDuration helper for parsing TimeOrDuration with kingpin.

func (*TimeOrDurationValue) PrometheusTimestamp

func (tdv *TimeOrDurationValue) PrometheusTimestamp() int64

PrometheusTimestamp returns TimeOrDurationValue converted to PrometheusTimestamp if duration is set now+duration is converted to Timestamp.

func (*TimeOrDurationValue) Set

func (tdv *TimeOrDurationValue) Set(s string) error

Set converts string to TimeOrDurationValue.

func (*TimeOrDurationValue) String

func (tdv *TimeOrDurationValue) String() string

String returns either time or duration.

Jump to

Keyboard shortcuts

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