Documentation ¶
Index ¶
- Variables
- func WriteForwardingResponseError(s io.Writer, err error) error
- func WriteInboundForwardingRequest(s io.Writer, remote peer.ID, protocolID protocol.ID) error
- func WriteOutboundForwardingRequest(s io.Writer, remote peer.ID, protocols []protocol.ID) error
- func WriteOutboundForwardingResponseSuccess(s io.Writer, remotePubKey crypto.PubKey, protocolID protocol.ID) error
- type ForwardingKind
- type ForwardingRequest
- type ForwardingResponse
- type ResponseCode
Constants ¶
This section is empty.
Variables ¶
var BindnodeRegistry = bindnoderegistry.NewRegistry()
BindnodeRegistry is the serialization/deserialization tool for messages
Functions ¶
func WriteForwardingResponseError ¶
WriteForwardingResponseError sends a routing response with code Rejected and a message containing the error to a io.Writer
func WriteInboundForwardingRequest ¶
WriteInboundForwardingRequest writes a new inbound forwarding request to a network strema
func WriteOutboundForwardingRequest ¶
WriteOutboundForwardingRequest writes a new outbound forwarding request to a network strema
Types ¶
type ForwardingKind ¶
type ForwardingKind string
ForwardingKind indicates the direction of a forwarding request
const ( // ForwardingInbound is a forwarding request initiated by the load balancer to a routed peer, requesting // forwarding of a public peers traffic inbound the routed peer ForwardingInbound ForwardingKind = "Inbound" // ForwardingOutbound is a forwarding request initaited by a routed peer to the load balancer requesting forward // of traffic outbound to a public peer ForwardingOutbound ForwardingKind = "Outbound" )
type ForwardingRequest ¶
type ForwardingRequest struct { Kind ForwardingKind Remote peer.ID Protocols []protocol.ID // Should always be length 1 for Inbound requests }
ForwardingRequest is a request to forward traffic through the load balancer
func ReadForwardingRequest ¶
func ReadForwardingRequest(s io.Reader) (*ForwardingRequest, error)
ReadForwardingRequest reads a forwarding request from a network stream
type ForwardingResponse ¶
type ForwardingResponse struct { Code ResponseCode Message string // more info if rejected ProtocolID *protocol.ID }
ForwardingResponse is a response to and outbound forwarding request
func ReadForwardingResponse ¶
func ReadForwardingResponse(s io.Reader) (*ForwardingResponse, error)
ReadForwardingResponse reads a forwarding response from a network stream
type ResponseCode ¶
type ResponseCode string
ResponseCode indicates a success or failure on either the register-routing or the forwarding protocols
const ( // ResponseOk indicates a request was successful ResponseOk ResponseCode = "Ok" // ResponseRejected indicates something went wrong in the request -- more information is supplied in the Message field // of the response ResponseRejected ResponseCode = "Rejected" )