Documentation
¶
Index ¶
Constants ¶
View Source
const (
ErrFieldNotHandled = "field not handled on decoding: %s"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
NewDecoder creates a new Decoder instance
Parameters:
- options: the additional settings for the decoder implementation
Returns:
- *Decoder: The decoder instance
type Mapper ¶ added in v0.2.0
type Mapper struct {
// contains filtered or unexported fields
}
Mapper is the struct to hold precomputed marshal by reflection functions
func NewMapper ¶ added in v0.2.0
NewMapper creates a new Mapper instance
Parameters:
- destinationInstance: the destination instance to create the mapper for
Returns:
- *Mapper: the new Mapper instance - error: the error if any
func (*Mapper) UnmarshalByReflection ¶ added in v0.2.0
func (m *Mapper) UnmarshalByReflection( body []byte, dest any, unmarshalOptions *protojson.UnmarshalOptions, ) error
UnmarshalByReflection unmarshal JSON data into a destination using reflection
Parameters:
- body: The JSON data to unmarshal
- dest: The destination to unmarshal the JSON data into
- unmarshalOptions: Options for unmarshalling proto messages (optional, can be nil)
Returns:
- error: The error if any
type Options ¶ added in v0.2.0
type Options struct {
// contains filtered or unexported fields
}
Options are the additional settings for the decoder implementation
func NewOptions ¶ added in v0.2.0
NewOptions creates a new Options instance
Parameters:
- cache: indicates whether to cache the precompute unmarshal by reflection functions
Returns:
- *Options: the new Options instance
Click to show internal directories.
Click to hide internal directories.