Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Interceptor = func(_ proto.Message) {}
Interceptor will be called with every proto before it is marshalled. Interceptor is not safe to modify concurrently with calls to Marshal.
Functions ¶
func Clone ¶
Clone uses proto.Clone to return a deep copy of pb. It panics if pb recursively contains any instances of types which are known to be unsupported by proto.Clone.
This function and its associated lint (see build/style_test.go) exist to ensure we do not attempt to proto.Clone types which are not supported by proto.Clone. This hackery is necessary because proto.Clone gives no direct indication that it has incompletely cloned a type; it merely logs to standard output (see https://github.com/golang/protobuf/blob/89238a3/proto/clone.go#L204).
The concrete case against which this is currently guarding may be resolved upstream, see https://github.com/gogo/protobuf/issues/147.
Types ¶
type JSONPb ¶
JSONPb is a gwruntime.Marshaler that uses github.com/gogo/protobuf/jsonpb.
func (*JSONPb) ContentType ¶
ContentType implements gwruntime.Marshaler.
func (*JSONPb) NewDecoder ¶
NewDecoder implements gwruntime.Marshaler.
func (*JSONPb) NewEncoder ¶
NewEncoder implements gwruntime.Marshaler.
type ProtoPb ¶
type ProtoPb struct{}
ProtoPb is a gwruntime.Marshaler that uses github.com/gogo/protobuf/proto.
func (*ProtoPb) ContentType ¶
ContentType implements gwruntime.Marshaler.
func (*ProtoPb) NewDecoder ¶
NewDecoder implements gwruntime.Marshaler.
func (*ProtoPb) NewEncoder ¶
NewEncoder implements gwruntime.Marshaler.