Documentation
¶
Index ¶
- func ExtractJSONPath(o *JSON, path string) (interface{}, bool)
- type Dynamic
- type JSON
- func (o *JSON) MarshalJSON() ([]byte, error)
- func (o *JSON) NestedMap() map[string]interface{}
- func (o *JSON) Scan(value interface{}) error
- func (o *JSON) SetValueAtPath(path string, value interface{})
- func (o *JSON) Value() (driver.Value, error)
- func (o *JSON) ValueAtPath(path string) (interface{}, bool)
- func (o *JSON) ValuesByPath() map[string]interface{}
- type JSONDeserializer
- type JSONSerializer
- type Variant
- func (v Variant) Any() interface{}
- func (v Variant) HasType() bool
- func (v Variant) MarshalJSON() ([]byte, error)
- func (v Variant) MarshalText() ([]byte, error)
- func (v Variant) Nil() bool
- func (v *Variant) Scan(value interface{}) error
- func (v Variant) Type() string
- func (v *Variant) UnmarshalJSON(data []byte) error
- func (v *Variant) UnmarshalText(text []byte) error
- func (v Variant) Value() (driver.Value, error)
- func (v Variant) WithType(chType string) Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractJSONPath ¶
ExtractJSONPath is a convenience function for asserting a path to a specific type. The underlying value is also extracted from its dynamic wrapper if present.
Types ¶
type Dynamic ¶
type Dynamic = Variant
func NewDynamic ¶
func NewDynamic(v interface{}) Dynamic
NewDynamic creates a new Dynamic with the given value
func NewDynamicWithType ¶
NewDynamicWithType creates a new Dynamic with the given value and Proton type
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
JSON represents a ClickHouse JSON type that can hold multiple possible types
func (*JSON) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (*JSON) SetValueAtPath ¶
func (*JSON) ValueAtPath ¶
func (*JSON) ValuesByPath ¶
type JSONDeserializer ¶
JSONDeserializer interface allows a struct to load its data from an optimized JSON structure instead of relying on recursive reflection to set its fields.
type JSONSerializer ¶
JSONSerializer interface allows a struct to be manually converted to an optimized JSON structure instead of relying on recursive reflection. Note that the struct must be a pointer in order for the interface to be matched, reflection will be used otherwise.
type Variant ¶
type Variant struct {
// contains filtered or unexported fields
}
Variant represents a Proton variant type that can hold multiple possible types
func NewVariant ¶
func NewVariant(v interface{}) Variant
NewVariant creates a new Variant with the given value
func NewVariantWithType ¶
NewVariantWithType creates a new Variant with the given value and Proton type
func (Variant) Any ¶
func (v Variant) Any() interface{}
Any returns the underlying value as interface{}.
func (Variant) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (Variant) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface
func (*Variant) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface
func (*Variant) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface