Documentation ¶
Index ¶
- func IsConnCanceled(err error) bool
- func LabelsToMetric(ls labels.Labels) model.Metric
- func LogConfig(cfg interface{}) error
- func MapToModelLabelSet(m map[string]string) model.LabelSet
- 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 SnakeCase(s string) string
- func StringRef(value string) *string
- func StringSliceContains(slice []string, value string) bool
- 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)
- type SizeReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConnCanceled ¶
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 ¶
LabelsToMetric converts a Labels to Metric Don't do this on any performance sensitive paths.
func LogConfig ¶
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 Plutono in easier which typically sorts newest entries at the top.
func MapToModelLabelSet ¶
MapToModelLabelSet converts a map into a model.LabelSet
func MergeStringLists ¶
func MergeStringPair ¶
func ModelLabelSetToMap ¶
ModelLabelSetToMap convert a model.LabelSet to a map[string]string
func PrintConfig ¶
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 ¶
RoundToMilliseconds returns milliseconds precision time from nanoseconds. from will be rounded down to the nearest milliseconds while through is rounded up.
func StringSliceContains ¶
Types ¶
type ExtendedMock ¶
func (*ExtendedMock) GetMockedCallsByMethod ¶
func (m *ExtendedMock) GetMockedCallsByMethod(method string) []mock.Call
type LogAdapter ¶
func NewLogAdapter ¶
func NewLogAdapter(l log.Logger) LogAdapter
func (LogAdapter) Fatalf ¶
func (l LogAdapter) Fatalf(format string, v ...interface{})
Fatalf implements tail.logger
func (LogAdapter) Fatalln ¶
func (l LogAdapter) Fatalln(v ...interface{})
Fatalln implements tail.logger
func (LogAdapter) Panicf ¶
func (l LogAdapter) Panicf(format string, v ...interface{})
Panicf implements tail.logger
func (LogAdapter) Panicln ¶
func (l LogAdapter) Panicln(v ...interface{})
Panicln implements tail.logger
func (LogAdapter) Printf ¶
func (l LogAdapter) Printf(format string, v ...interface{})
Printf implements tail.logger
func (LogAdapter) Println ¶
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
func (MultiError) Is ¶
func (es MultiError) Is(target error) bool
Is tells if all errors are the same as the target error.
type QueryStringBuilder ¶
type QueryStringBuilder struct {
// contains filtered or unexported fields
}
func NewQueryStringBuilder ¶
func NewQueryStringBuilder() *QueryStringBuilder
func (*QueryStringBuilder) Encode ¶
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 ¶
func (b *QueryStringBuilder) SetFloat(name string, value float64)
func (*QueryStringBuilder) SetFloat32 ¶
func (b *QueryStringBuilder) SetFloat32(name string, value float32)
func (*QueryStringBuilder) SetInt ¶
func (b *QueryStringBuilder) SetInt(name string, value int64)
func (*QueryStringBuilder) SetInt32 ¶
func (b *QueryStringBuilder) SetInt32(name string, value int)
func (*QueryStringBuilder) SetString ¶
func (b *QueryStringBuilder) SetString(name, value string)
func (*QueryStringBuilder) SetStringArray ¶
func (b *QueryStringBuilder) SetStringArray(name string, values []string)
type SizeReader ¶
func NewSizeReader ¶
func NewSizeReader(r io.Reader) SizeReader
NewSizeReader returns an io.Reader that will have the number of bytes read from r available.