util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModelLabelSetToMap

func ModelLabelSetToMap(m model.LabelSet) map[string]string

ModelLabelSetToMap convert a model.LabelSet to a map[string]string

func RoundToMilliseconds added in v0.2.0

func RoundToMilliseconds(from, through time.Time) (model.Time, model.Time)

RoundToMilliseconds returns milliseconds precision time from nanoseconds. from will be rounded down to the nearest milliseconds while through is rounded up.

func ToClientLabels

func ToClientLabels(labels string) ([]client.LabelAdapter, error)

ToClientLabels parses the labels and converts them to the Cortex type.

func TokenFor added in v0.2.0

func TokenFor(userID, labels string) uint32

TokenFor generates a token used for finding ingesters from ring

Types

type ExtendedMock added in v0.2.0

type ExtendedMock struct {
	mock.Mock
}

func (*ExtendedMock) GetMockedCallsByMethod added in v0.2.0

func (m *ExtendedMock) GetMockedCallsByMethod(method string) []mock.Call

type MultiError

type MultiError []error

The MultiError type implements the error interface, and contains the Errors used to construct it.

func (*MultiError) Add

func (es *MultiError) Add(err error)

Add adds the error to the error list if it is not nil.

func (MultiError) Err

func (es MultiError) Err() error

Err returns the error list as an error or nil if it is empty.

func (MultiError) Error

func (es MultiError) Error() string

Returns a concatenated string of the contained errors

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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