Documentation ¶
Index ¶
- Variables
- func MsgLogString(msg Message) string
- type Advertisement
- type AdvertisementProvider
- type Forwarder
- type HTTPForwarder
- type Ingress
- type Message
- type MessageHandler
- type PeeringClient
- type PeeringClientStat
- type PeeringServer
- type PeeringServerStat
- type PingForwarder
- type Router
- type RouterListener
- type RouterShink
- type RouterUnregister
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRoute = errors.New("no route found to handle given request")
View Source
var ErrPeerNoConnection = errors.New("no connection available for the peer")
View Source
var ErrPeeringDown = errors.New("Peering connection not available")
View Source
var ErrUnknownPeer = errors.New("no route to deliver")
Functions ¶
func MsgLogString ¶
Types ¶
type Advertisement ¶
type Advertisement *generated.Advertisement
type AdvertisementProvider ¶
type AdvertisementProvider = func(ctx context.Context) (Advertisement, error)
type HTTPForwarder ¶
type HTTPForwarder interface { Forwarder NewRoundTripper(cfg *config.HTTPIngressConfig) http.RoundTripper }
type Message ¶
type Message = *generated.PeerMessage
type MessageHandler ¶
type PeeringClient ¶
type PeeringClient interface { String() string Close(ctx context.Context) error Stat() PeeringClientStat }
type PeeringClientStat ¶
type PeeringClientStat struct { PeeringAttempts uint64 PeeringConnected uint64 HandshakeAttempts uint64 HandshakeSucceeded uint64 PeerMessageReceived uint64 }
func (*PeeringClientStat) Clone ¶
func (stat *PeeringClientStat) Clone() PeeringClientStat
func (PeeringClientStat) String ¶
func (stat PeeringClientStat) String() string
type PeeringServer ¶
type PeeringServerStat ¶
type PeeringServerStat struct { PeeringConnections uint64 HandshakeAttempts uint64 HandshakeSucceeded uint64 PeerMessageReceived uint64 }
func (*PeeringServerStat) Clone ¶
func (stat *PeeringServerStat) Clone() PeeringServerStat
func (PeeringServerStat) String ¶
func (stat PeeringServerStat) String() string
type PingForwarder ¶
type Router ¶
type Router interface { // NodeID returns this node itself's ID NodeID() config.NodeID SetAdvertisementProvider(advFn AdvertisementProvider) // Advertisement returns this node's Advertisement (= this node's capability) GenerateAdvertisement(ctx context.Context) (Advertisement, error) // Update routing based on incoming advertisement Update(ctx context.Context, node config.NodeID, ad Advertisement) // Route decides destination route // Returns ErrNoRoute if no route found Route(ctx context.Context, request Message) (config.NodeID, error) // Deliver transfer given message or handle that message in this node itself Deliver(ctx context.Context, from config.NodeID, dest config.NodeID, msg Message) // RegisterSink registers message deliverery route to another node. // Given destination must not equal to this node's ID. RegisterSink(dest config.NodeID, callback RouterShink) RouterUnregister // Listen regisgers callback for incoming messsage. // Lisnter will be called for all mesages that destination is this node. // All listeners called every time, should close unnesessary listener. Listen(callback RouterListener) RouterUnregister Close(ctx context.Context) error }
type RouterListener ¶
type RouterUnregister ¶
type RouterUnregister = func()
Click to show internal directories.
Click to hide internal directories.