Skip to content

Edge Routing

Implementation file: rpc_edge.go

Define edgeRPCServer, process Peer lookup, assignment and route resolve on the Edge Giznet service; uniformly encode RPC results, and map peerroute, Peer and KV errors to RPC error codes.

Core structure and main function

SymbolFunction
edgeRPCServerHolds authoritative Peer route service.
HandleRun an RPC loop on the Edge service connection.
dispatchDistributes Edge route RPC methods.
handleLookupQuery the current assignment of the Peer.
handleAssignCreate or update Peer assignment.
handleResolveParse the effective route of the target Peer.
edgeRequiredParamsDecode and verify required params.
edgeRPCResult / edgeRPCErrorEncoding typed result or mapping field error.