Documentation
¶
Index ¶
- type Builder
- func Bool(key string, v bool) Builder
- func BoolSlice(key string, v []bool) Builder
- func Float64(key string, v float64) Builder
- func Float64Slice(key string, v []float64) Builder
- func Int(key string, value int) Builder
- func Int64(key string, value int64) Builder
- func Int64Slice(key string, v []int64) Builder
- func IntSlice(key string, v []int) Builder
- func String(key, value string) Builder
- func StringSlice(key string, v []string) Builder
- 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 Uint64Value(v uint64) 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) AsUint64() uint64
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) String() string
- func (v Value) Type() Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
func Float64Slice ¶ added in v0.44.0
Float64Slice returns a Builder for a float64 slice.
func Int64Slice ¶ added in v0.44.0
Int64Slice returns a Builder for an int64 slice.
func StringSlice ¶ added in v0.44.0
StringSlice returns a Builder for a string slice.
type Type ¶
type Type int // redefines builtin Type.
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 // UINT64 is a 64-bit unsigned integral Type Value. // // This type is intentionally not exposed through the Builder API. UINT64 )
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents the value part in key-value pairs.
func BoolSliceValue ¶ added in v0.44.0
BoolSliceValue creates a BOOLSLICE Value.
func Float64SliceValue ¶ added in v0.44.0
Float64SliceValue creates a FLOAT64SLICE Value.
func Int64SliceValue ¶ added in v0.44.0
Int64SliceValue creates an INT64SLICE Value.
func IntSliceValue ¶ added in v0.44.0
IntSliceValue creates an INTSLICE Value.
func StringSliceValue ¶ added in v0.44.0
StringSliceValue creates a STRINGSLICE Value.
func Uint64Value ¶ added in v0.43.0
Uint64Value creates a UINT64 Value.
This constructor is intentionally not exposed through the Builder API.
func (Value) AsBoolSlice ¶ added in v0.44.0
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 ¶ added in v0.44.0
AsFloat64Slice returns the []float64 value. Make sure that the Value's type is FLOAT64SLICE.
func (Value) AsInt64Slice ¶ added in v0.44.0
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 ¶ added in v0.44.0
AsStringSlice returns the []string value. Make sure that the Value's type is STRINGSLICE.
func (Value) AsUint64 ¶ added in v0.43.0
AsUint64 returns the uint64 value. Make sure that the Value's type is UINT64.
func (Value) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the Value.