server already knows this one
(v interface{})
| 52 | |
| 53 | func (passthroughCodec) Name() string { return "proto" } // server already knows this one |
| 54 | func (passthroughCodec) Marshal(v interface{}) ([]byte, error) { |
| 55 | if m, ok := v.(*rawMessage); ok { |
| 56 | return m.data, nil // send bytes exactly as we received them |
| 57 | } |
| 58 | return proto.Marshal(v.(proto.Message)) |
| 59 | } |
| 60 | func (passthroughCodec) Unmarshal(data []byte, v interface{}) error { |
| 61 | if m, ok := v.(*rawMessage); ok { |
| 62 | m.data = append([]byte(nil), data...) |
no outgoing calls