mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-04-11 11:21:59 +02:00
Rename log List value type to Slice (#4936)
This commit is contained in:
parent
59413575e4
commit
6e2bfb69ed
@ -262,7 +262,7 @@ const (
|
||||
KindInt64
|
||||
KindString
|
||||
KindBytes
|
||||
KindList
|
||||
KindSlice
|
||||
KindMap
|
||||
)
|
||||
|
||||
@ -282,7 +282,7 @@ func BoolValue(v bool) Value
|
||||
|
||||
func BytesValue(v []byte) Value
|
||||
|
||||
func ListValue(vs ...Value) Value
|
||||
func SliceValue(vs ...Value) Value
|
||||
|
||||
func MapValue(kvs ...KeyValue) Value
|
||||
|
||||
@ -300,7 +300,7 @@ func (v Value) AsFloat64() float64
|
||||
|
||||
func (v Value) AsBytes() []byte
|
||||
|
||||
func (v Value) AsList() []Value
|
||||
func (v Value) AsSlice() []Value
|
||||
|
||||
func (v Value) AsMap() []KeyValue
|
||||
|
||||
@ -330,7 +330,7 @@ func Bool(key string, v bool) KeyValue
|
||||
|
||||
func Bytes(key string, v []byte) KeyValue
|
||||
|
||||
func List(key string, args ...Value) KeyValue
|
||||
func Slice(key string, args ...Value) KeyValue
|
||||
|
||||
func Map(key string, args ...KeyValue) KeyValue
|
||||
|
||||
@ -349,7 +349,7 @@ func (a KeyValue) Equal(b KeyValue) bool
|
||||
`KindInt64` is used for a signed integer value.
|
||||
`KindString` is used for a string value.
|
||||
`KindBytes` is used for a slice of bytes (in spec: A byte array).
|
||||
`KindList` is used for a slice of values (in spec: an array (a list) of any values).
|
||||
`KindSlice` is used for a slice of values (in spec: an array (a list) of any values).
|
||||
`KindMap` is used for a slice of key-value pairs (in spec: `map<string, any>`).
|
||||
|
||||
These types are defined in `go.opentelemetry.io/otel/log` package
|
||||
|
@ -27,7 +27,7 @@ const (
|
||||
KindInt64
|
||||
KindString
|
||||
KindBytes
|
||||
KindList
|
||||
KindSlice
|
||||
KindMap
|
||||
)
|
||||
|
||||
@ -56,9 +56,9 @@ func BoolValue(v bool) Value { //nolint:revive // Not a control flag.
|
||||
// changed after it is passed.
|
||||
func BytesValue(v []byte) Value { return Value{} } // TODO (#4914): implement.
|
||||
|
||||
// ListValue returns a [Value] for a slice of [Value]. The passed slice must
|
||||
// SliceValue returns a [Value] for a slice of [Value]. The passed slice must
|
||||
// not be changed after it is passed.
|
||||
func ListValue(vs ...Value) Value { return Value{} } // TODO (#4914): implement.
|
||||
func SliceValue(vs ...Value) Value { return Value{} } // TODO (#4914): implement.
|
||||
|
||||
// MapValue returns a new [Value] for a slice of key-value pairs. The passed
|
||||
// slice must not be changed after it is passed.
|
||||
@ -82,8 +82,8 @@ func (v Value) AsFloat64() float64 { return 0 } // TODO (#4914): implement
|
||||
// AsBytes returns the value held by v as a []byte.
|
||||
func (v Value) AsBytes() []byte { return nil } // TODO (#4914): implement
|
||||
|
||||
// AsList returns the value held by v as a []Value.
|
||||
func (v Value) AsList() []Value { return nil } // TODO (#4914): implement
|
||||
// AsSlice returns the value held by v as a []Value.
|
||||
func (v Value) AsSlice() []Value { return nil } // TODO (#4914): implement
|
||||
|
||||
// AsMap returns the value held by v as a []KeyValue.
|
||||
func (v Value) AsMap() []KeyValue { return nil } // TODO (#4914): implement
|
||||
@ -125,8 +125,8 @@ func Bool(key string, v bool) KeyValue { return KeyValue{} } // TODO (#4914): im
|
||||
// Bytes returns an KeyValue for a []byte value.
|
||||
func Bytes(key string, v []byte) KeyValue { return KeyValue{} } // TODO (#4914): implement
|
||||
|
||||
// List returns an KeyValue for a []Value value.
|
||||
func List(key string, args ...Value) KeyValue { return KeyValue{} } // TODO (#4914): implement
|
||||
// Slice returns an KeyValue for a []Value value.
|
||||
func Slice(key string, args ...Value) KeyValue { return KeyValue{} } // TODO (#4914): implement
|
||||
|
||||
// Map returns an KeyValue for a map value.
|
||||
func Map(key string, args ...KeyValue) KeyValue { return KeyValue{} } // TODO (#4914): implement
|
||||
|
@ -14,13 +14,13 @@ func _() {
|
||||
_ = x[KindInt64-3]
|
||||
_ = x[KindString-4]
|
||||
_ = x[KindBytes-5]
|
||||
_ = x[KindList-6]
|
||||
_ = x[KindSlice-6]
|
||||
_ = x[KindMap-7]
|
||||
}
|
||||
|
||||
const _Kind_name = "EmptyBoolFloat64Int64StringBytesListMap"
|
||||
const _Kind_name = "EmptyBoolFloat64Int64StringBytesSliceMap"
|
||||
|
||||
var _Kind_index = [...]uint8{0, 5, 9, 16, 21, 27, 32, 36, 39}
|
||||
var _Kind_index = [...]uint8{0, 5, 9, 16, 21, 27, 32, 37, 40}
|
||||
|
||||
func (i Kind) String() string {
|
||||
if i < 0 || i >= Kind(len(_Kind_index)-1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user