NewNodeAwareServerCodec returns new NodeAwareServerCodec with normal rpc.ServerCode and proto.RawNodeID.
(ctx context.Context, codec rpc.ServerCodec, nodeID *proto.RawNodeID)
| 32 | |
| 33 | // NewNodeAwareServerCodec returns new NodeAwareServerCodec with normal rpc.ServerCode and proto.RawNodeID. |
| 34 | func NewNodeAwareServerCodec(ctx context.Context, codec rpc.ServerCodec, nodeID *proto.RawNodeID) *NodeAwareServerCodec { |
| 35 | return &NodeAwareServerCodec{ |
| 36 | ServerCodec: codec, |
| 37 | NodeID: nodeID, |
| 38 | Ctx: ctx, |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // ReadRequestBody override default rpc.ServerCodec behaviour and inject remote node id into request. |
| 43 | func (nc *NodeAwareServerCodec) ReadRequestBody(body interface{}) (err error) { |
no outgoing calls
no test coverage detected