MCPcopy
hub / github.com/golang/protobuf / JSONPBMarshaler

Interface JSONPBMarshaler

jsonpb/encode.go:62–64  ·  jsonpb/encode.go::JSONPBMarshaler

JSONPBMarshaler is implemented by protobuf messages that customize the way they are marshaled to JSON. Messages that implement this should also implement JSONPBUnmarshaler so that the custom format can be parsed. The JSON marshaling must follow the proto to JSON specification: https://developers.

Source from the content-addressed store, hash-verified

60//
61// Deprecated: Custom types should implement protobuf reflection instead.
62type JSONPBMarshaler interface {
63 MarshalJSONPB(*Marshaler) ([]byte, error)
64}
65
66// Marshal serializes a protobuf message as JSON into w.
67func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error {

Callers 2

marshalMethod · 0.65
marshalMessageMethod · 0.65

Implementers 1

dynamicMessagejsonpb/json_test.go

Calls

no outgoing calls

Tested by

no test coverage detected