server

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientHelloRPC

func ClientHelloRPC(ctx context.Context, stream relayrpc.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 relayrpc.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 relayrpc.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

func ClientTLSConfig(tlsCrt string, tlsKey string, rootCA string, addr string) (*tls.Config, error)

ClientTLSConfig sets tls config

func GetPeerCache

func GetPeerCache(cache *ristretto.Cache, key interface{}) (string, bool)

GetPeerCache get value from cache and if more than 1 rnadomly select the peer

func InitPeerCache

func InitPeerCache(evict OnEvict) (*ristretto.Cache, error)

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.

func InsertPeerCache

func InsertPeerCache(cache *ristretto.Cache, expiry time.Duration, key, value interface{}) bool

InsertPeerCache inserts the value to cache

func NewAuditInfoServer

NewAuditInfoServer returns new Audit Information Server

func NewAuditLogServer

func NewAuditLogServer(auditLogService q.AuditLogService) (v1.AuditLogServiceServer, error)

NewAuditServer returns new placement server implementation

func NewAuthServer

func NewAuthServer(as authv3.AuthService) rpcv3.AuthServiceServer

NewAuthServer returns new auth server implementation

func NewBootstrapServer

NewBootstrapServer return new bootstrap server

func NewClusterServer

NewClusterServer returns new cluster server implementation

func NewGroupServer

func NewGroupServer(ps service.GroupService) rpcv3.GroupServiceServer

NewGroupServer returns new group server implementation

func NewKubectlClusterSettingsServer

NewKubectlClusterSettingsServer returns new kubectl cluster setting server

func NewLocationServer

NewLocationServer returns new location server implementation

func NewOrganizationServer

NewOrganizationServer returns new organization server implementation

func NewPartnerServer

NewPartnerServer returns new partner server implementation

func NewProjectServer

NewProjectServer returns new project server implementation

func NewRelayAuditServer

func NewRelayAuditServer(relayAuditService q.RelayAuditService, relayCommandAuditService q.AuditLogService) (v1.RelayAuditServiceServer, error)

NewAuditServer returns new placement server implementation

func NewRelayPeerService

func NewRelayPeerService() (sentryrpc.RelayPeerServiceServer, error)

NewRelayPeerService returns new placement server implementation

func NewRolePermissionServer

NewRolePermissionServer returns new role server implementation

func NewRoleServer

func NewRoleServer(ps service.RoleService) rpcv3.RoleServiceServer

NewRoleServer returns new role server implementation

func NewUserServer

NewUserServer returns new user server implementation

func RunRelaySurveyHandler

func RunRelaySurveyHandler(stop <-chan struct{}, svc interface{})

RunRelaySurveyHandler is the cotrol loop that maintains the peer suvey messages.

Types

type OnEvict

type OnEvict = func(*ristretto.Item)

type RelayAgentDownloadData

type RelayAgentDownloadData struct {
	ClusterID     string
	SentryAddr    string
	Token         string
	RelayImage    string
	HostName      string
	TemplateName  string
	TemplateToken string
}

type RelayClusterConnectionInfo

type RelayClusterConnectionInfo struct {
	Relayuuid string
	Relayip   string
}

RelayClusterConnectionInfo relay conn info

type RelayNetworkDownloadData

type RelayNetworkDownloadData struct {
	SentryAddr     string
	PeerHost       string
	PeerToken      string
	UserToken      string
	ConnectorToken string
	RelayImage     string
	UserHostPort   string
	RelayHostPort  string
	RelayNetworkID string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL