package value
import "go.opentelemetry.io/otel/api/kv/value"
Index ¶
- type Type
- type Value
- func Array(array interface{}) Value
- func Bool(v bool) Value
- func Float32(v float32) Value
- func Float64(v float64) Value
- func Int(v int) Value
- func Int32(v int32) Value
- func Int64(v int64) Value
- func String(v string) Value
- func Uint(v uint) Value
- func Uint32(v uint32) Value
- func Uint64(v uint64) Value
- func (v Value) AsArray() interface{}
- func (v Value) AsBool() bool
- func (v Value) AsFloat32() float32
- func (v Value) AsFloat64() float64
- func (v Value) AsInt32() int32
- func (v Value) AsInt64() int64
- func (v Value) AsInterface() interface{}
- func (v Value) AsString() string
- func (v Value) AsUint32() uint32
- func (v Value) AsUint64() uint64
- func (v Value) Emit() string
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Type() Type
Types ¶
type Type ¶
type Type int
Type describes the type of the data Value holds.
const ( INVALID Type = iota // No value. BOOL // Boolean value, use AsBool() to get it. INT32 // 32 bit signed integral value, use AsInt32() to get it. INT64 // 64 bit signed integral value, use AsInt64() to get it. UINT32 // 32 bit unsigned integral value, use AsUint32() to get it. UINT64 // 64 bit unsigned integral value, use AsUint64() to get it. FLOAT32 // 32 bit floating point value, use AsFloat32() to get it. FLOAT64 // 64 bit floating point value, use AsFloat64() to get it. STRING // String value, use AsString() to get it. ARRAY // Array value of arbitrary type, use AsArray() to get it. )
func (Type) String ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents the value part in key-value pairs.
func Array ¶
func Array(array interface{}) Value
Array creates an ARRAY value.
func Bool ¶
Bool creates a BOOL Value.
func Float32 ¶
Float32 creates a FLOAT32 Value.
func Float64 ¶
Float64 creates a FLOAT64 Value.
func Int ¶
Int creates either an INT32 or an INT64 Value, depending on whether the int type is 32 or 64 bits wide.
func Int32 ¶
Int32 creates an INT32 Value.
func Int64 ¶
Int64 creates an INT64 Value.
func String ¶
String creates a STRING Value.
func Uint ¶
Uint creates either a UINT32 or a UINT64 Value, depending on whether the uint type is 32 or 64 bits wide.
func Uint32 ¶
Uint32 creates a UINT32 Value.
func Uint64 ¶
Uint64 creates a UINT64 Value.
func (Value) AsArray ¶
func (v Value) AsArray() interface{}
AsArray returns the array Value as an interface{}.
func (Value) AsBool ¶
AsBool returns the bool value. Make sure that the Value's type is BOOL.
func (Value) AsFloat32 ¶
AsFloat32 returns the float32 value. Make sure that the Value's type is FLOAT32.
func (Value) AsFloat64 ¶
AsFloat64 returns the float64 value. Make sure that the Value's type is FLOAT64.
func (Value) AsInt32 ¶
AsInt32 returns the int32 value. Make sure that the Value's type is INT32.
func (Value) AsInt64 ¶
AsInt64 returns the int64 value. Make sure that the Value's type is INT64.
func (Value) AsInterface ¶
func (v Value) AsInterface() interface{}
AsInterface returns Value's data as interface{}.
func (Value) AsString ¶
AsString returns the string value. Make sure that the Value's type is STRING.
func (Value) AsUint32 ¶
AsUint32 returns the uint32 value. Make sure that the Value's type is UINT32.
func (Value) AsUint64 ¶
AsUint64 returns the uint64 value. Make sure that the Value's type is UINT64.
func (Value) Emit ¶
Emit returns a string representation of Value's data.
func (Value) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the Value.
func (Value) Type ¶
Type returns a type of the Value.
Source Files ¶
type_string.go value.go
- Version
- v0.9.0
- Published
- Jul 20, 2020
- Platform
- darwin/amd64
- Imports
- 7 packages
- Last checked
- 51 minutes ago –
Tools for package owners.