Documentation
¶
Index ¶
- type Value
- func Any(v any) Value
- func Bool(t bool) Value
- func Byte(x byte) Value
- func Bytes(b []byte) Value
- func CustomBits(x uint64) Value
- func Float32(x float32) Value
- func Float64(f float64) Value
- func Int(x int) Value
- func Int16(x int16) Value
- func Int32(x int32) Value
- func Int64(x int64) Value
- func Int8(x int8) Value
- func Nil() Value
- func String(s string) Value
- func StringWithTag(s string, tag uint16) Value
- func Uint(x uint) Value
- func Uint16(x uint16) Value
- func Uint32(x uint32) Value
- func Uint64(x uint64) Value
- func Uint8(x uint8) Value
- func (v Value) Any() any
- func (v Value) Bool() bool
- func (v Value) Byte() byte
- func (v Value) Bytes() []byte
- func (v Value) Float32() float32
- func (v Value) Float64() float64
- func (v Value) Int() int
- func (v Value) Int16() int16
- func (v Value) Int32() int32
- func (v Value) Int64() int64
- func (v Value) Int8() int8
- func (v Value) IsBool() bool
- func (v Value) IsBytes() bool
- func (v Value) IsCustomBits() bool
- func (v Value) IsFloat() bool
- func (v Value) IsInt() bool
- func (v Value) IsNil() bool
- func (v Value) IsNumber() bool
- func (v Value) IsString() bool
- func (v Value) IsUint() bool
- func (v Value) String() string
- func (v Value) Tag() uint16
- func (v Value) Uint() uint
- func (v Value) Uint16() uint16
- func (v Value) Uint32() uint32
- func (v Value) Uint64() uint64
- func (v Value) Uint8() uint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is a boxed value
func StringWithTag ¶
StringWithTag boxes a string value and adds a custom tag.
func (Value) Bytes ¶
Bytes returns the value as a byte slice. When the boxed value is a `[]byte` then those original bytes are returned. Otherwise, the string representation of the value is returned, which will be equivalent to `[]byte(value.String())`.
func (Value) IsCustomBits ¶
IsCustomBits returns true if the boxed value was created using box.CustomBits.
func (Value) IsFloat ¶
IsFloat returns true if the boxed value is an float-like primitive: float32, float64
func (Value) IsInt ¶
IsInt returns true if the boxed value is an int-like primitive: int, int8, int16, int32, int64, byte
func (Value) IsNumber ¶
IsNumber returns true if the boxed value is an numeric-like primitive: int, int8, int16, int32, int64, byte, uint, uint8, uint16, uint32, uint64, float32, float64
func (Value) IsUint ¶
IsUint returns true if the boxed value is an uint-like primitive: uint, uint8, uint16, uint32, uint64