Marshaler defines a conversion between byte sequence and gRPC payloads / fields.
| 6 | |
| 7 | // Marshaler defines a conversion between byte sequence and gRPC payloads / fields. |
| 8 | type 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 |
| 25 | type Decoder interface { |
no outgoing calls
no test coverage detected