Documentation ¶
Overview ¶
Package attribute provides key and value attributes.
Index ¶
- func BoolToRaw(b bool) uint64
- func Float64ToRaw(f float64) uint64
- func Int64ToRaw(i int64) uint64
- func RawPtrToFloat64Ptr(r *uint64) *float64
- func RawPtrToInt64Ptr(r *uint64) *int64
- func RawToBool(r uint64) bool
- func RawToFloat64(r uint64) float64
- func RawToInt64(r uint64) int64
- type Key
- func (k Key) Bool(v bool) KeyValue
- func (k Key) BoolSlice(v []bool) KeyValue
- func (k Key) Defined() bool
- func (k Key) Float64(v float64) KeyValue
- func (k Key) Float64Slice(v []float64) KeyValue
- func (k Key) Int(v int) KeyValue
- func (k Key) Int64(v int64) KeyValue
- func (k Key) Int64Slice(v []int64) KeyValue
- func (k Key) IntSlice(v []int) KeyValue
- func (k Key) String(v string) KeyValue
- func (k Key) StringSlice(v []string) KeyValue
- type KeyValue
- func Bool(k string, v bool) KeyValue
- func BoolSlice(k string, v []bool) KeyValue
- func Float64(k string, v float64) KeyValue
- func Float64Slice(k string, v []float64) KeyValue
- func Int(k string, v int) KeyValue
- func Int64(k string, v int64) KeyValue
- func Int64Slice(k string, v []int64) KeyValue
- func IntSlice(k string, v []int) KeyValue
- func String(k, v string) KeyValue
- func StringSlice(k string, v []string) KeyValue
- func Stringer(k string, v fmt.Stringer) KeyValue
- type Type
- type Value
- func BoolSliceValue(v []bool) Value
- func BoolValue(v bool) Value
- func Float64SliceValue(v []float64) Value
- func Float64Value(v float64) Value
- func Int64SliceValue(v []int64) Value
- func Int64Value(v int64) Value
- func IntSliceValue(v []int) Value
- func IntValue(v int) Value
- func StringSliceValue(v []string) Value
- func StringValue(v string) Value
- func (v Value) AsBool() bool
- func (v Value) AsBoolSlice() []bool
- func (v Value) AsFloat64() float64
- func (v Value) AsFloat64Slice() []float64
- func (v Value) AsInt64() int64
- func (v Value) AsInt64Slice() []int64
- func (v Value) AsInterface() interface{}
- func (v Value) AsString() string
- func (v Value) AsStringSlice() []string
- func (v Value) Emit() string
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Type() Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float64ToRaw ¶
func Int64ToRaw ¶
func RawPtrToFloat64Ptr ¶
func RawPtrToInt64Ptr ¶
func RawToFloat64 ¶
func RawToInt64 ¶
Types ¶
type Key ¶
type Key string
Key represents the key part in key-value pairs. It's a string. The allowed character set in the key depends on the use of the key.
func (Key) Bool ¶
Bool creates a KeyValue instance with a BOOL Value.
If creating both a key and value at the same time, use the provided convenience function instead -- Bool(name, value).
func (Key) BoolSlice ¶
BoolSlice creates a KeyValue instance with a BOOLSLICE Value.
If creating both a key and value at the same time, use the provided convenience function instead -- BoolSlice(name, value).
func (Key) Float64 ¶
Float64 creates a KeyValue instance with a FLOAT64 Value.
If creating both a key and value at the same time, use the provided convenience function instead -- Float64(name, value).
func (Key) Float64Slice ¶
Float64Slice creates a KeyValue instance with a FLOAT64SLICE Value.
If creating both a key and value at the same time, use the provided convenience function instead -- Float64(name, value).
func (Key) Int ¶
Int creates a KeyValue instance with an INT64 Value.
If creating both a key and value at the same time, use the provided convenience function instead -- Int(name, value).
func (Key) Int64 ¶
Int64 creates a KeyValue instance with an INT64 Value.
If creating both a key and value at the same time, use the provided convenience function instead -- Int64(name, value).
func (Key) Int64Slice ¶
Int64Slice creates a KeyValue instance with an INT64SLICE Value.
If creating both a key and value at the same time, use the provided convenience function instead -- Int64Slice(name, value).
func (Key) IntSlice ¶
IntSlice creates a KeyValue instance with an INT64SLICE Value.
If creating both a key and value at the same time, use the provided convenience function instead -- IntSlice(name, value).
func (Key) String ¶
String creates a KeyValue instance with a STRING Value.
If creating both a key and value at the same time, use the provided convenience function instead -- String(name, value).
func (Key) StringSlice ¶
StringSlice creates a KeyValue instance with a STRINGSLICE Value.
If creating both a key and value at the same time, use the provided convenience function instead -- StringSlice(name, value).
type KeyValue ¶
KeyValue holds a key and value pair.
func Float64Slice ¶
Float64Slice creates a KeyValue with a FLOAT64SLICE Value type.
func Int64Slice ¶
Int64Slice creates a KeyValue with an INT64SLICE Value type.
func StringSlice ¶
StringSlice creates a KeyValue with a STRINGSLICE Value type.
type Type ¶
type Type int
Type describes the type of the data Value holds.
const ( // INVALID is used for a Value with no value set. INVALID Type = iota // BOOL is a boolean Type Value. BOOL // INT64 is a 64-bit signed integral Type Value. INT64 // FLOAT64 is a 64-bit floating point Type Value. FLOAT64 // STRING is a string Type Value. STRING // BOOLSLICE is a slice of booleans Type Value. BOOLSLICE // INT64SLICE is a slice of 64-bit signed integral numbers Type Value. INT64SLICE // FLOAT64SLICE is a slice of 64-bit floating point numbers Type Value. FLOAT64SLICE // STRINGSLICE is a slice of strings Type Value. STRINGSLICE )
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents the value part in key-value pairs.
func Float64SliceValue ¶
Float64SliceValue creates a FLOAT64SLICE Value.
func Int64SliceValue ¶
Int64SliceValue creates an INT64SLICE Value.
func StringSliceValue ¶
StringSliceValue creates a STRINGSLICE Value.
func (Value) AsBoolSlice ¶
AsBoolSlice returns the []bool value. Make sure that the Value's type is BOOLSLICE.
func (Value) AsFloat64 ¶
AsFloat64 returns the float64 value. Make sure that the Value's type is FLOAT64.
func (Value) AsFloat64Slice ¶
AsFloat64Slice returns the []float64 value. Make sure that the Value's type is INT64SLICE.
func (Value) AsInt64Slice ¶
AsInt64Slice returns the []int64 value. Make sure that the Value's type is INT64SLICE.
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) AsStringSlice ¶
AsStringSlice returns the []string value. Make sure that the Value's type is INT64SLICE.
func (Value) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the Value.