Skip to content

DatapointDecoder.Unmarshal

func (d datasets.DatapointDecoder) Unmarshal(
descriptor *datasets.DatapointDescriptor,
data []byte,
) (map[string]any, error)

Decode a raw protobuf datapoint into a JSON-like map with configurable protobuf decoding options.

descriptor *datasets.DatapointDescriptor required

The descriptor returned by NewDatapointDescriptor.

data []byte required

The raw protobuf datapoint bytes returned by a datapoint query.

AllowPartial bool

Allow messages that are missing required fields.

DiscardUnknown bool

Ignore unknown fields in the raw protobuf message.

Resolver

Override the resolver used to look up message and extension types.

RecursionLimit int

Limit how deeply nested messages may be decoded. A zero value uses the protobuf default.

A map of datapoint fields, or an error if the raw datapoint cannot be decoded.