var ( // Msg is a key used to add message strings to label lists. Msg = NewString("message", "a readable message") // Label is a key used to indicate an event adds labels to the context. Label = NewTag("label", "a label context marker") // Start is used for things like traces that have a name. Start = NewString("start", "span start") // Metric is a key used to indicate an event records metrics. End = NewTag("end", "a span end marker") // Metric is a key used to indicate an event records metrics. Detach = NewTag("detach", "a span detach marker") // Err is a key used to add error values to label lists. Err = NewError("error", "an error that occurred") // Metric is a key used to indicate an event records metrics. Metric = NewTag("metric", "a metric event marker") )
func Join[S ~[]T, T ~string](s S) string
Join returns a canonical join of the keys in S: a sorted comma-separated string list.
Boolean represents a key
type Boolean struct {
// contains filtered or unexported fields
}
func NewBoolean(name, description string) *Boolean
NewBoolean creates a new Key for bool values.
func (k *Boolean) Description() string
func (k *Boolean) Format(w io.Writer, buf []byte, l label.Label)
func (k *Boolean) From(t label.Label) bool
From can be used to get a value from a Label.
func (k *Boolean) Get(lm label.Map) bool
Get can be used to get a label for the key from a label.Map.
func (k *Boolean) Name() string
func (k *Boolean) Of(v bool) label.Label
Of creates a new Label with this key and the supplied value.
Error represents a key
type Error struct {
// contains filtered or unexported fields
}
func NewError(name, description string) *Error
NewError creates a new Key for int64 values.
func (k *Error) Description() string
func (k *Error) Format(w io.Writer, buf []byte, l label.Label)
func (k *Error) From(t label.Label) error
From can be used to get a value from a Label.
func (k *Error) Get(lm label.Map) error
Get can be used to get a label for the key from a label.Map.
func (k *Error) Name() string
func (k *Error) Of(v error) label.Label
Of creates a new Label with this key and the supplied value.
Float32 represents a key
type Float32 struct {
// contains filtered or unexported fields
}
func NewFloat32(name, description string) *Float32
NewFloat32 creates a new Key for float32 values.
func (k *Float32) Description() string
func (k *Float32) Format(w io.Writer, buf []byte, l label.Label)
func (k *Float32) From(t label.Label) float32
From can be used to get a value from a Label.
func (k *Float32) Get(lm label.Map) float32
Get can be used to get a label for the key from a label.Map.
func (k *Float32) Name() string
func (k *Float32) Of(v float32) label.Label
Of creates a new Label with this key and the supplied value.
Float64 represents a key
type Float64 struct {
// contains filtered or unexported fields
}
func NewFloat64(name, description string) *Float64
NewFloat64 creates a new Key for int64 values.
func (k *Float64) Description() string
func (k *Float64) Format(w io.Writer, buf []byte, l label.Label)
func (k *Float64) From(t label.Label) float64
From can be used to get a value from a Label.
func (k *Float64) Get(lm label.Map) float64
Get can be used to get a label for the key from a label.Map.
func (k *Float64) Name() string
func (k *Float64) Of(v float64) label.Label
Of creates a new Label with this key and the supplied value.
Int represents a key
type Int struct {
// contains filtered or unexported fields
}
func NewInt(name, description string) *Int
NewInt creates a new Key for int values.
func (k *Int) Description() string
func (k *Int) Format(w io.Writer, buf []byte, l label.Label)
func (k *Int) From(t label.Label) int
From can be used to get a value from a Label.
func (k *Int) Get(lm label.Map) int
Get can be used to get a label for the key from a label.Map.
func (k *Int) Name() string
func (k *Int) Of(v int) label.Label
Of creates a new Label with this key and the supplied value.
Int16 represents a key
type Int16 struct {
// contains filtered or unexported fields
}
func NewInt16(name, description string) *Int16
NewInt16 creates a new Key for int16 values.
func (k *Int16) Description() string
func (k *Int16) Format(w io.Writer, buf []byte, l label.Label)
func (k *Int16) From(t label.Label) int16
From can be used to get a value from a Label.
func (k *Int16) Get(lm label.Map) int16
Get can be used to get a label for the key from a label.Map.
func (k *Int16) Name() string
func (k *Int16) Of(v int16) label.Label
Of creates a new Label with this key and the supplied value.
Int32 represents a key
type Int32 struct {
// contains filtered or unexported fields
}
func NewInt32(name, description string) *Int32
NewInt32 creates a new Key for int32 values.
func (k *Int32) Description() string
func (k *Int32) Format(w io.Writer, buf []byte, l label.Label)
func (k *Int32) From(t label.Label) int32
From can be used to get a value from a Label.
func (k *Int32) Get(lm label.Map) int32
Get can be used to get a label for the key from a label.Map.
func (k *Int32) Name() string
func (k *Int32) Of(v int32) label.Label
Of creates a new Label with this key and the supplied value.
Int64 represents a key
type Int64 struct {
// contains filtered or unexported fields
}
func NewInt64(name, description string) *Int64
NewInt64 creates a new Key for int64 values.
func (k *Int64) Description() string
func (k *Int64) Format(w io.Writer, buf []byte, l label.Label)
func (k *Int64) From(t label.Label) int64
From can be used to get a value from a Label.
func (k *Int64) Get(lm label.Map) int64
Get can be used to get a label for the key from a label.Map.
func (k *Int64) Name() string
func (k *Int64) Of(v int64) label.Label
Of creates a new Label with this key and the supplied value.
Int8 represents a key
type Int8 struct {
// contains filtered or unexported fields
}
func NewInt8(name, description string) *Int8
NewInt8 creates a new Key for int8 values.
func (k *Int8) Description() string
func (k *Int8) Format(w io.Writer, buf []byte, l label.Label)
func (k *Int8) From(t label.Label) int8
From can be used to get a value from a Label.
func (k *Int8) Get(lm label.Map) int8
Get can be used to get a label for the key from a label.Map.
func (k *Int8) Name() string
func (k *Int8) Of(v int8) label.Label
Of creates a new Label with this key and the supplied value.
String represents a key
type String struct {
// contains filtered or unexported fields
}
func NewString(name, description string) *String
NewString creates a new Key for int64 values.
func (k *String) Description() string
func (k *String) Format(w io.Writer, buf []byte, l label.Label)
func (k *String) From(t label.Label) string
From can be used to get a value from a Label.
func (k *String) Get(lm label.Map) string
Get can be used to get a label for the key from a label.Map.
func (k *String) Name() string
func (k *String) Of(v string) label.Label
Of creates a new Label with this key and the supplied value.
Tag represents a key for tagging labels that have no value. These are used when the existence of the label is the entire information it carries, such as marking events to be of a specific kind, or from a specific package.
type Tag struct {
// contains filtered or unexported fields
}
func NewTag(name, description string) *Tag
NewTag creates a new Key for tagging labels.
func (k *Tag) Description() string
func (k *Tag) Format(w io.Writer, buf []byte, l label.Label)
func (k *Tag) Name() string
func (k *Tag) New() label.Label
New creates a new Label with this key.
UInt represents a key
type UInt struct {
// contains filtered or unexported fields
}
func NewUInt(name, description string) *UInt
NewUInt creates a new Key for uint values.
func (k *UInt) Description() string
func (k *UInt) Format(w io.Writer, buf []byte, l label.Label)
func (k *UInt) From(t label.Label) uint
From can be used to get a value from a Label.
func (k *UInt) Get(lm label.Map) uint
Get can be used to get a label for the key from a label.Map.
func (k *UInt) Name() string
func (k *UInt) Of(v uint) label.Label
Of creates a new Label with this key and the supplied value.
UInt16 represents a key
type UInt16 struct {
// contains filtered or unexported fields
}
func NewUInt16(name, description string) *UInt16
NewUInt16 creates a new Key for uint16 values.
func (k *UInt16) Description() string
func (k *UInt16) Format(w io.Writer, buf []byte, l label.Label)
func (k *UInt16) From(t label.Label) uint16
From can be used to get a value from a Label.
func (k *UInt16) Get(lm label.Map) uint16
Get can be used to get a label for the key from a label.Map.
func (k *UInt16) Name() string
func (k *UInt16) Of(v uint16) label.Label
Of creates a new Label with this key and the supplied value.
UInt32 represents a key
type UInt32 struct {
// contains filtered or unexported fields
}
func NewUInt32(name, description string) *UInt32
NewUInt32 creates a new Key for uint32 values.
func (k *UInt32) Description() string
func (k *UInt32) Format(w io.Writer, buf []byte, l label.Label)
func (k *UInt32) From(t label.Label) uint32
From can be used to get a value from a Label.
func (k *UInt32) Get(lm label.Map) uint32
Get can be used to get a label for the key from a label.Map.
func (k *UInt32) Name() string
func (k *UInt32) Of(v uint32) label.Label
Of creates a new Label with this key and the supplied value.
UInt64 represents a key
type UInt64 struct {
// contains filtered or unexported fields
}
func NewUInt64(name, description string) *UInt64
NewUInt64 creates a new Key for uint64 values.
func (k *UInt64) Description() string
func (k *UInt64) Format(w io.Writer, buf []byte, l label.Label)
func (k *UInt64) From(t label.Label) uint64
From can be used to get a value from a Label.
func (k *UInt64) Get(lm label.Map) uint64
Get can be used to get a label for the key from a label.Map.
func (k *UInt64) Name() string
func (k *UInt64) Of(v uint64) label.Label
Of creates a new Label with this key and the supplied value.
UInt8 represents a key
type UInt8 struct {
// contains filtered or unexported fields
}
func NewUInt8(name, description string) *UInt8
NewUInt8 creates a new Key for uint8 values.
func (k *UInt8) Description() string
func (k *UInt8) Format(w io.Writer, buf []byte, l label.Label)
func (k *UInt8) From(t label.Label) uint8
From can be used to get a value from a Label.
func (k *UInt8) Get(lm label.Map) uint8
Get can be used to get a label for the key from a label.Map.
func (k *UInt8) Name() string
func (k *UInt8) Of(v uint8) label.Label
Of creates a new Label with this key and the supplied value.
Value represents a key for untyped values.
type Value struct {
// contains filtered or unexported fields
}
func New(name, description string) *Value
New creates a new Key for untyped values.
func (k *Value) Description() string
func (k *Value) Format(w io.Writer, buf []byte, l label.Label)
func (k *Value) From(t label.Label) interface{}
From can be used to get a value from a Label.
func (k *Value) Get(lm label.Map) interface{}
Get can be used to get a label for the key from a label.Map.
func (k *Value) Name() string
func (k *Value) Of(value interface{}) label.Label
Of creates a new Label with this key and the supplied value.