Documentation
¶
Index ¶
- func ClientHelloRPC(ctx context.Context, stream sentryrpc.RelayPeerService_RelayPeerHelloRPCClient, ...)
- func ClientProbeRPC(ctx context.Context, stream sentryrpc.RelayPeerService_RelayPeerProbeRPCClient, ...)
- func ClientSurveyRPC(ctx context.Context, ...)
- func ClientTLSConfig(tlsCrt string, tlsKey string, rootCA string, addr string) (*tls.Config, error)
- func GetPeerCache(cache *ristretto.Cache, key interface{}) (string, bool)
- func GetPeeringServerCreds(ctx context.Context, bs service.BootstrapService, rpcPort int, host string) (cert, key, ca []byte, err error)
- func InitPeerCache(evict OnEvict) (*ristretto.Cache, error)
- func InsertPeerCache(cache *ristretto.Cache, expiry time.Duration, key, value interface{}) bool
- type OnEvict
- type RelayClusterConnectionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientHelloRPC ¶
func ClientHelloRPC(ctx context.Context, stream sentryrpc.RelayPeerService_RelayPeerHelloRPCClient, interval time.Duration, relayUUID string, ip func() string)
ClientHelloRPC will handle periodic heartbeat messages between relay and the core service.
func ClientProbeRPC ¶
func ClientProbeRPC(ctx context.Context, stream sentryrpc.RelayPeerService_RelayPeerProbeRPCClient, pcache *ristretto.Cache, relayUUID string, expiry time.Duration, peerProbeChanel chan string, ip func() string)
ClientProbeRPC will manage the probes. When a relay neeed to probe for connections for a cluster it will add a probe message to probe channel. The probe rpc will send that message to probe core service. When a probe response get inserted to peerCache.
func ClientSurveyRPC ¶
func ClientSurveyRPC(ctx context.Context, stream sentryrpc.RelayPeerService_RelayPeerSurveyRPCClient, relayUUID string, ip func() string, dialinlookup func(string) int)
ClientSurveyRPC will handle the survey RPC. When a relay neeed to probe for connections for a cluster it will message to probe core service. The service then sends survey to all the connected relays (survey-request). On survey request, the relay will lookup its local-dialin-map and reply to core if connection from the given cluster is available.
func ClientTLSConfig ¶
ClientTLSConfig sets tls config
func GetPeerCache ¶
GetPeerCache get value from cache and if more than 1 rnadomly select the peer
func GetPeeringServerCreds ¶
func GetPeeringServerCreds(ctx context.Context, bs service.BootstrapService, rpcPort int, host string) (cert, key, ca []byte, err error)
GetPeeringServerCreds returns peering cert, key, ca
func InitPeerCache ¶
InitPeerCache initialize the cache to store dialin cluster-connection information of peers. When a dialin miss happens look into this cache to find the peer IP address to forward the user connection.
Types ¶
type RelayClusterConnectionInfo ¶
RelayClusterConnectionInfo relay conn info