// Copyright The OpenTelemetry Authors// SPDX-License-Identifier: Apache-2.0package attribute // import "go.opentelemetry.io/otel/attribute"import ()// KeyValue holds a key and value pair.typeKeyValuestruct { Key Key Value Value}// Valid reports whether kv is a valid OpenTelemetry attribute.func ( KeyValue) () bool {return .Key.Defined() && .Value.Type() != INVALID}// Bool creates a KeyValue with a BOOL Value type.func ( string, bool) KeyValue {returnKey().Bool()}// BoolSlice creates a KeyValue with a BOOLSLICE Value type.func ( string, []bool) KeyValue {returnKey().BoolSlice()}// Int creates a KeyValue with an INT64 Value type.func ( string, int) KeyValue {returnKey().Int()}// IntSlice creates a KeyValue with an INT64SLICE Value type.func ( string, []int) KeyValue {returnKey().IntSlice()}// Int64 creates a KeyValue with an INT64 Value type.func ( string, int64) KeyValue {returnKey().Int64()}// Int64Slice creates a KeyValue with an INT64SLICE Value type.func ( string, []int64) KeyValue {returnKey().Int64Slice()}// Float64 creates a KeyValue with a FLOAT64 Value type.func ( string, float64) KeyValue {returnKey().Float64()}// Float64Slice creates a KeyValue with a FLOAT64SLICE Value type.func ( string, []float64) KeyValue {returnKey().Float64Slice()}// String creates a KeyValue with a STRING Value type.func (, string) KeyValue {returnKey().String()}// StringSlice creates a KeyValue with a STRINGSLICE Value type.func ( string, []string) KeyValue {returnKey().StringSlice()}// Stringer creates a new key-value pair with a passed name and a string// value generated by the passed Stringer interface.func ( string, fmt.Stringer) KeyValue {returnKey().String(.String())}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.