utils

package
v1.65.0-cluster Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TLSConfig

func TLSConfig(certFile, keyFile, CAFile, serverName string, insecureSkipVerify bool) (*tls.Config, error)

TLSConfig creates tls.Config object from provided arguments

func Transport

func Transport(URL, certFile, keyFile, CAFile, serverName string, insecureSkipVerify bool) (*http.Transport, error)

Transport creates http.Transport object based on provided URL. Returns Transport with TLS configuration if URL contains `https` prefix

Types

type ErrGroup

type ErrGroup struct {
	// contains filtered or unexported fields
}

ErrGroup accumulates multiple errors and produces single error message.

func (*ErrGroup) Add

func (eg *ErrGroup) Add(err error)

Add adds a new error to group. Isn't thread-safe.

func (*ErrGroup) Err

func (eg *ErrGroup) Err() error

Err checks if group contains at least one error.

func (*ErrGroup) Error

func (eg *ErrGroup) Error() string

Error satisfies Error interface

type PromDuration added in v1.63.0

type PromDuration struct {
	// contains filtered or unexported fields
}

PromDuration is Prometheus duration.

func NewPromDuration added in v1.63.0

func NewPromDuration(d time.Duration) PromDuration

NewPromDuration returns PromDuration for given d.

func (*PromDuration) Duration added in v1.63.0

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

Duration returns duration for pd.

func (PromDuration) MarshalYAML added in v1.63.0

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

MarshalYAML implements yaml.Marshaler interface.

func (*PromDuration) UnmarshalYAML added in v1.63.0

func (pd *PromDuration) 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