Documentation ¶
Index ¶
- func IsConnCanceled(err error) bool
- func LabelsToMetric(ls labels.Labels) model.Metric
- func LogConfig(cfg interface{}) error
- func MergeStringLists(ss ...[]string) []string
- func MergeStringPair(s1, s2 []string) []string
- func ModelLabelSetToMap(m model.LabelSet) map[string]string
- func PrintConfig(w io.Writer, config interface{}) error
- func RoundToMilliseconds(from, through time.Time) (model.Time, model.Time)
- func StringRef(value string) *string
- func StringSliceContains(slice []string, value string) bool
- func ToClientLabels(labels string) ([]client.LabelAdapter, error)
- func TokenFor(userID, labels string) uint32
- type ExtendedMock
- type LogAdapter
- func (l LogAdapter) Fatal(v ...interface{})
- func (l LogAdapter) Fatalf(format string, v ...interface{})
- func (l LogAdapter) Fatalln(v ...interface{})
- func (l LogAdapter) Panic(v ...interface{})
- func (l LogAdapter) Panicf(format string, v ...interface{})
- func (l LogAdapter) Panicln(v ...interface{})
- func (l LogAdapter) Print(v ...interface{})
- func (l LogAdapter) Printf(format string, v ...interface{})
- func (l LogAdapter) Println(v ...interface{})
- type MultiError
- type QueryStringBuilder
- func (b *QueryStringBuilder) Encode() string
- func (b *QueryStringBuilder) SetFloat(name string, value float64)
- func (b *QueryStringBuilder) SetFloat32(name string, value float32)
- func (b *QueryStringBuilder) SetInt(name string, value int64)
- func (b *QueryStringBuilder) SetInt32(name string, value int)
- func (b *QueryStringBuilder) SetString(name, value string)
- func (b *QueryStringBuilder) SetStringArray(name string, values []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConnCanceled ¶ added in v0.4.0
IsConnCanceled returns true, if error is from a closed gRPC connection. copied from https://github.com/etcd-io/etcd/blob/7f47de84146bdc9225d2080ec8678ca8189a2d2b/clientv3/client.go#L646
func LabelsToMetric ¶ added in v0.4.0
LabelsToMetric converts a Labels to Metric Don't do this on any performance sensitive paths.
func LogConfig ¶ added in v1.6.0
func LogConfig(cfg interface{}) error
LogConfig takes a pointer to a config object, marshalls it to YAML and prints each line in REVERSE order The reverse order makes display in Grafana in easier which typically sorts newest entries at the top.
func MergeStringLists ¶ added in v1.5.0
func MergeStringPair ¶ added in v1.5.0
func ModelLabelSetToMap ¶
ModelLabelSetToMap convert a model.LabelSet to a map[string]string
func PrintConfig ¶ added in v1.6.0
PrintConfig will takes a pointer to a config object, marshalls it to YAML and prints the result to the provided writer unlike LogConfig, PrintConfig prints the object in naturally ocurring order.
func RoundToMilliseconds ¶ added in v0.2.0
RoundToMilliseconds returns milliseconds precision time from nanoseconds. from will be rounded down to the nearest milliseconds while through is rounded up.
func StringSliceContains ¶ added in v0.4.0
func ToClientLabels ¶
func ToClientLabels(labels string) ([]client.LabelAdapter, error)
ToClientLabels parses the labels and converts them to the Cortex type.
Types ¶
type ExtendedMock ¶ added in v0.2.0
func (*ExtendedMock) GetMockedCallsByMethod ¶ added in v0.2.0
func (m *ExtendedMock) GetMockedCallsByMethod(method string) []mock.Call
type LogAdapter ¶ added in v1.5.0
func NewLogAdapter ¶ added in v1.5.0
func NewLogAdapter(l log.Logger) LogAdapter
func (LogAdapter) Fatal ¶ added in v1.5.0
func (l LogAdapter) Fatal(v ...interface{})
Fatal implements tail.logger
func (LogAdapter) Fatalf ¶ added in v1.5.0
func (l LogAdapter) Fatalf(format string, v ...interface{})
Fatalf implements tail.logger
func (LogAdapter) Fatalln ¶ added in v1.5.0
func (l LogAdapter) Fatalln(v ...interface{})
Fatalln implements tail.logger
func (LogAdapter) Panic ¶ added in v1.5.0
func (l LogAdapter) Panic(v ...interface{})
Panic implements tail.logger
func (LogAdapter) Panicf ¶ added in v1.5.0
func (l LogAdapter) Panicf(format string, v ...interface{})
Panicf implements tail.logger
func (LogAdapter) Panicln ¶ added in v1.5.0
func (l LogAdapter) Panicln(v ...interface{})
Panicln implements tail.logger
func (LogAdapter) Print ¶ added in v1.5.0
func (l LogAdapter) Print(v ...interface{})
Print implements tail.logger
func (LogAdapter) Printf ¶ added in v1.5.0
func (l LogAdapter) Printf(format string, v ...interface{})
Printf implements tail.logger
func (LogAdapter) Println ¶ added in v1.5.0
func (l LogAdapter) Println(v ...interface{})
Println implements tail.logger
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
type QueryStringBuilder ¶ added in v0.4.0
type QueryStringBuilder struct {
// contains filtered or unexported fields
}
func NewQueryStringBuilder ¶ added in v0.4.0
func NewQueryStringBuilder() *QueryStringBuilder
func (*QueryStringBuilder) Encode ¶ added in v0.4.0
func (b *QueryStringBuilder) Encode() string
Encode returns the URL-encoded query string based on key-value parameters added to the builder calling Set functions.
func (*QueryStringBuilder) SetFloat ¶ added in v0.4.0
func (b *QueryStringBuilder) SetFloat(name string, value float64)
func (*QueryStringBuilder) SetFloat32 ¶ added in v0.4.0
func (b *QueryStringBuilder) SetFloat32(name string, value float32)
func (*QueryStringBuilder) SetInt ¶ added in v0.4.0
func (b *QueryStringBuilder) SetInt(name string, value int64)
func (*QueryStringBuilder) SetInt32 ¶ added in v0.4.0
func (b *QueryStringBuilder) SetInt32(name string, value int)
func (*QueryStringBuilder) SetString ¶ added in v0.4.0
func (b *QueryStringBuilder) SetString(name, value string)
func (*QueryStringBuilder) SetStringArray ¶ added in v1.5.0
func (b *QueryStringBuilder) SetStringArray(name string, values []string)