promutils

package
v1.82.1-cluster Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 2 Imported by: 59

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses duration string in Prometheus format

Types

type Duration

type Duration struct {
	D time.Duration
}

Duration is duration, which must be used in Prometheus-compatible yaml configs.

func NewDuration

func NewDuration(d time.Duration) *Duration

NewDuration returns Duration for given d.

func (*Duration) Duration

func (pd *Duration) Duration() time.Duration

Duration returns duration for pd.

func (Duration) MarshalYAML

func (pd Duration) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler interface.

func (*Duration) UnmarshalYAML

func (pd *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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