Documentation ¶
Overview ¶
Package jsonpb provides marshalling/unmarshalling functionality between protocol buffer and JSON objects.
Compared to encoding/json, this library:
- encodes int64, uint64 as strings
- optionally encodes enums as strings
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Marshaller ¶
type Marshaller struct { // Use string values for enums (as opposed to integer values) EnumsAsString bool // A string to indent each level by. The presence of this field will // also cause a space to appear between the field separator and // value, and for newlines to be appear between fields and array // elements. Indent string }
Marshaller is a configurable object for converting between protocol buffer objects and a JSON representation for them
func (*Marshaller) MarshalToString ¶
func (m *Marshaller) MarshalToString(pb proto.Message) (string, error)
MarshalToString converts a protocol buffer object to JSON string.
Click to show internal directories.
Click to hide internal directories.