MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / NewNodeAwareServerCodec

Function NewNodeAwareServerCodec

rpc/codec.go:34–40  ·  view source on GitHub ↗

NewNodeAwareServerCodec returns new NodeAwareServerCodec with normal rpc.ServerCode and proto.RawNodeID.

(ctx context.Context, codec rpc.ServerCodec, nodeID *proto.RawNodeID)

Source from the content-addressed store, hash-verified

32
33// NewNodeAwareServerCodec returns new NodeAwareServerCodec with normal rpc.ServerCode and proto.RawNodeID.
34func 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.
43func (nc *NodeAwareServerCodec) ReadRequestBody(body interface{}) (err error) {

Callers 2

ServeMuxFunction · 0.92
ServeDirectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected