MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / Marshaler

Interface Marshaler

runtime/marshaler.go:8–22  ·  runtime/marshaler.go::Marshaler

Marshaler defines a conversion between byte sequence and gRPC payloads / fields.

Source from the content-addressed store, hash-verified

6
7// Marshaler defines a conversion between byte sequence and gRPC payloads / fields.
8type Marshaler interface {
9 // Marshal marshals "v" into byte sequence.
10 Marshal(v interface{}) ([]byte, error)
11 // Unmarshal unmarshals "data" into "v".
12 // "v" must be a pointer value.
13 Unmarshal(data []byte, v interface{}) error
14 // NewDecoder returns a Decoder which reads byte sequence from "r".
15 NewDecoder(r io.Reader) Decoder
16 // NewEncoder returns an Encoder which writes bytes sequence into "w".
17 NewEncoder(w io.Writer) Encoder
18 // ContentType returns the Content-Type which this marshaler is responsible for.
19 // The parameter describes the type which is being marshalled, which can sometimes
20 // affect the content type returned.
21 ContentType(v interface{}) string
22}
23
24// Decoder decodes a byte sequence
25type Decoder interface {

Callers 37

emitRespFunction · 0.65
TestRawExampleFunction · 0.65
MarshalJSONMethod · 0.65
extensionMarshalJSONFunction · 0.65
TestGenerateXGoTypeFunction · 0.65
MarshalJSONMethod · 0.65
toYAMLNodeMethod · 0.65
TestGenerate_YAMLFunction · 0.65
TestGenerateExtensionFunction · 0.65
TestGenerateYAMLFunction · 0.65

Implementers 4

ProtoMarshallerruntime/marshal_proto.go
JSONPbruntime/marshal_jsonpb.go
JSONBuiltinruntime/marshal_json.go
CustomMarshalerruntime/handler_test.go

Calls

no outgoing calls

Tested by

no test coverage detected