keys

package
v0.11.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)

Functions

func Join

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.

Types

type Boolean

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

Boolean represents a key

func NewBoolean

func NewBoolean(name, description string) *Boolean

NewBoolean creates a new Key for bool values.

func (*Boolean) Description

func (k *Boolean) Description() string

func (*Boolean) Format

func (k *Boolean) Format(w io.Writer, buf []byte, l label.Label)

func (*Boolean) From

func (k *Boolean) From(t label.Label) bool

From can be used to get a value from a Label.

func (*Boolean) Get

func (k *Boolean) Get(lm label.Map) bool

Get can be used to get a label for the key from a label.Map.

func (*Boolean) Name

func (k *Boolean) Name() string

func (*Boolean) Of

func (k *Boolean) Of(v bool) label.Label

Of creates a new Label with this key and the supplied value.

type Error

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

Error represents a key

func NewError

func NewError(name, description string) *Error

NewError creates a new Key for int64 values.

func (*Error) Description

func (k *Error) Description() string

func (*Error) Format

func (k *Error) Format(w io.Writer, buf []byte, l label.Label)

func (*Error) From

func (k *Error) From(t label.Label) error

From can be used to get a value from a Label.

func (*Error) Get

func (k *Error) Get(lm label.Map) error

Get can be used to get a label for the key from a label.Map.

func (*Error) Name

func (k *Error) Name() string

func (*Error) Of

func (k *Error) Of(v error) label.Label

Of creates a new Label with this key and the supplied value.

type Float32

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

Float32 represents a key

func NewFloat32

func NewFloat32(name, description string) *Float32

NewFloat32 creates a new Key for float32 values.

func (*Float32) Description

func (k *Float32) Description() string

func (*Float32) Format

func (k *Float32) Format(w io.Writer, buf []byte, l label.Label)

func (*Float32) From

func (k *Float32) From(t label.Label) float32

From can be used to get a value from a Label.

func (*Float32) Get

func (k *Float32) Get(lm label.Map) float32

Get can be used to get a label for the key from a label.Map.

func (*Float32) Name

func (k *Float32) Name() string

func (*Float32) Of

func (k *Float32) Of(v float32) label.Label

Of creates a new Label with this key and the supplied value.

type Float64

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

Float64 represents a key

func NewFloat64

func NewFloat64(name, description string) *Float64

NewFloat64 creates a new Key for int64 values.

func (*Float64) Description

func (k *Float64) Description() string

func (*Float64) Format

func (k *Float64) Format(w io.Writer, buf []byte, l label.Label)

func (*Float64) From

func (k *Float64) From(t label.Label) float64

From can be used to get a value from a Label.

func (*Float64) Get

func (k *Float64) Get(lm label.Map) float64

Get can be used to get a label for the key from a label.Map.

func (*Float64) Name

func (k *Float64) Name() string

func (*Float64) Of

func (k *Float64) Of(v float64) label.Label

Of creates a new Label with this key and the supplied value.

type Int

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

Int represents a key

func NewInt

func NewInt(name, description string) *Int

NewInt creates a new Key for int values.

func (*Int) Description

func (k *Int) Description() string

func (*Int) Format

func (k *Int) Format(w io.Writer, buf []byte, l label.Label)

func (*Int) From

func (k *Int) From(t label.Label) int

From can be used to get a value from a Label.

func (*Int) Get

func (k *Int) Get(lm label.Map) int

Get can be used to get a label for the key from a label.Map.

func (*Int) Name

func (k *Int) Name() string

func (*Int) Of

func (k *Int) Of(v int) label.Label

Of creates a new Label with this key and the supplied value.

type Int16

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

Int16 represents a key

func NewInt16

func NewInt16(name, description string) *Int16

NewInt16 creates a new Key for int16 values.

func (*Int16) Description

func (k *Int16) Description() string

func (*Int16) Format

func (k *Int16) Format(w io.Writer, buf []byte, l label.Label)

func (*Int16) From

func (k *Int16) From(t label.Label) int16

From can be used to get a value from a Label.

func (*Int16) Get

func (k *Int16) Get(lm label.Map) int16

Get can be used to get a label for the key from a label.Map.

func (*Int16) Name

func (k *Int16) Name() string

func (*Int16) Of

func (k *Int16) Of(v int16) label.Label

Of creates a new Label with this key and the supplied value.

type Int32

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

Int32 represents a key

func NewInt32

func NewInt32(name, description string) *Int32

NewInt32 creates a new Key for int32 values.

func (*Int32) Description

func (k *Int32) Description() string

func (*Int32) Format

func (k *Int32) Format(w io.Writer, buf []byte, l label.Label)

func (*Int32) From

func (k *Int32) From(t label.Label) int32

From can be used to get a value from a Label.

func (*Int32) Get

func (k *Int32) Get(lm label.Map) int32

Get can be used to get a label for the key from a label.Map.

func (*Int32) Name

func (k *Int32) Name() string

func (*Int32) Of

func (k *Int32) Of(v int32) label.Label

Of creates a new Label with this key and the supplied value.

type Int64

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

Int64 represents a key

func NewInt64

func NewInt64(name, description string) *Int64

NewInt64 creates a new Key for int64 values.

func (*Int64) Description

func (k *Int64) Description() string

func (*Int64) Format

func (k *Int64) Format(w io.Writer, buf []byte, l label.Label)

func (*Int64) From

func (k *Int64) From(t label.Label) int64

From can be used to get a value from a Label.

func (*Int64) Get

func (k *Int64) Get(lm label.Map) int64

Get can be used to get a label for the key from a label.Map.

func (*Int64) Name

func (k *Int64) Name() string

func (*Int64) Of

func (k *Int64) Of(v int64) label.Label

Of creates a new Label with this key and the supplied value.

type Int8

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

Int8 represents a key

func NewInt8

func NewInt8(name, description string) *Int8

NewInt8 creates a new Key for int8 values.

func (*Int8) Description

func (k *Int8) Description() string

func (*Int8) Format

func (k *Int8) Format(w io.Writer, buf []byte, l label.Label)

func (*Int8) From

func (k *Int8) From(t label.Label) int8

From can be used to get a value from a Label.

func (*Int8) Get

func (k *Int8) Get(lm label.Map) int8

Get can be used to get a label for the key from a label.Map.

func (*Int8) Name

func (k *Int8) Name() string

func (*Int8) Of

func (k *Int8) Of(v int8) label.Label

Of creates a new Label with this key and the supplied value.

type String

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

String represents a key

func NewString

func NewString(name, description string) *String

NewString creates a new Key for int64 values.

func (*String) Description

func (k *String) Description() string

func (*String) Format

func (k *String) Format(w io.Writer, buf []byte, l label.Label)

func (*String) From

func (k *String) From(t label.Label) string

From can be used to get a value from a Label.

func (*String) Get

func (k *String) Get(lm label.Map) string

Get can be used to get a label for the key from a label.Map.

func (*String) Name

func (k *String) Name() string

func (*String) Of

func (k *String) Of(v string) label.Label

Of creates a new Label with this key and the supplied value.

type Tag

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

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.

func NewTag

func NewTag(name, description string) *Tag

NewTag creates a new Key for tagging labels.

func (*Tag) Description

func (k *Tag) Description() string

func (*Tag) Format

func (k *Tag) Format(w io.Writer, buf []byte, l label.Label)

func (*Tag) Name

func (k *Tag) Name() string

func (*Tag) New

func (k *Tag) New() label.Label

New creates a new Label with this key.

type UInt

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

UInt represents a key

func NewUInt

func NewUInt(name, description string) *UInt

NewUInt creates a new Key for uint values.

func (*UInt) Description

func (k *UInt) Description() string

func (*UInt) Format

func (k *UInt) Format(w io.Writer, buf []byte, l label.Label)

func (*UInt) From

func (k *UInt) From(t label.Label) uint

From can be used to get a value from a Label.

func (*UInt) Get

func (k *UInt) Get(lm label.Map) uint

Get can be used to get a label for the key from a label.Map.

func (*UInt) Name

func (k *UInt) Name() string

func (*UInt) Of

func (k *UInt) Of(v uint) label.Label

Of creates a new Label with this key and the supplied value.

type UInt16

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

UInt16 represents a key

func NewUInt16

func NewUInt16(name, description string) *UInt16

NewUInt16 creates a new Key for uint16 values.

func (*UInt16) Description

func (k *UInt16) Description() string

func (*UInt16) Format

func (k *UInt16) Format(w io.Writer, buf []byte, l label.Label)

func (*UInt16) From

func (k *UInt16) From(t label.Label) uint16

From can be used to get a value from a Label.

func (*UInt16) Get

func (k *UInt16) Get(lm label.Map) uint16

Get can be used to get a label for the key from a label.Map.

func (*UInt16) Name

func (k *UInt16) Name() string

func (*UInt16) Of

func (k *UInt16) Of(v uint16) label.Label

Of creates a new Label with this key and the supplied value.

type UInt32

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

UInt32 represents a key

func NewUInt32

func NewUInt32(name, description string) *UInt32

NewUInt32 creates a new Key for uint32 values.

func (*UInt32) Description

func (k *UInt32) Description() string

func (*UInt32) Format

func (k *UInt32) Format(w io.Writer, buf []byte, l label.Label)

func (*UInt32) From

func (k *UInt32) From(t label.Label) uint32

From can be used to get a value from a Label.

func (*UInt32) Get

func (k *UInt32) Get(lm label.Map) uint32

Get can be used to get a label for the key from a label.Map.

func (*UInt32) Name

func (k *UInt32) Name() string

func (*UInt32) Of

func (k *UInt32) Of(v uint32) label.Label

Of creates a new Label with this key and the supplied value.

type UInt64

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

UInt64 represents a key

func NewUInt64

func NewUInt64(name, description string) *UInt64

NewUInt64 creates a new Key for uint64 values.

func (*UInt64) Description

func (k *UInt64) Description() string

func (*UInt64) Format

func (k *UInt64) Format(w io.Writer, buf []byte, l label.Label)

func (*UInt64) From

func (k *UInt64) From(t label.Label) uint64

From can be used to get a value from a Label.

func (*UInt64) Get

func (k *UInt64) Get(lm label.Map) uint64

Get can be used to get a label for the key from a label.Map.

func (*UInt64) Name

func (k *UInt64) Name() string

func (*UInt64) Of

func (k *UInt64) Of(v uint64) label.Label

Of creates a new Label with this key and the supplied value.

type UInt8

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

UInt8 represents a key

func NewUInt8

func NewUInt8(name, description string) *UInt8

NewUInt8 creates a new Key for uint8 values.

func (*UInt8) Description

func (k *UInt8) Description() string

func (*UInt8) Format

func (k *UInt8) Format(w io.Writer, buf []byte, l label.Label)

func (*UInt8) From

func (k *UInt8) From(t label.Label) uint8

From can be used to get a value from a Label.

func (*UInt8) Get

func (k *UInt8) Get(lm label.Map) uint8

Get can be used to get a label for the key from a label.Map.

func (*UInt8) Name

func (k *UInt8) Name() string

func (*UInt8) Of

func (k *UInt8) Of(v uint8) label.Label

Of creates a new Label with this key and the supplied value.

type Value

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

Value represents a key for untyped values.

func New

func New(name, description string) *Value

New creates a new Key for untyped values.

func (*Value) Description

func (k *Value) Description() string

func (*Value) Format

func (k *Value) Format(w io.Writer, buf []byte, l label.Label)

func (*Value) From

func (k *Value) From(t label.Label) interface{}

From can be used to get a value from a Label.

func (*Value) Get

func (k *Value) Get(lm label.Map) interface{}

Get can be used to get a label for the key from a label.Map.

func (*Value) Name

func (k *Value) Name() string

func (*Value) Of

func (k *Value) Of(value interface{}) label.Label

Of creates a new Label with this key and the supplied value.

Jump to

Keyboard shortcuts

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