Documentation ¶
Index ¶
- type NodeInfo
- type RegistryListener
- type RegistryServer
- func (rs *RegistryServer) AddListener(l RegistryListener)
- func (rs *RegistryServer) ConnectToNodeController(nodeId string) (*grpc.ClientConn, error)
- func (rs *RegistryServer) GetNodeController(nodeID string) (NodeInfo, error)
- func (rs *RegistryServer) NodeClients() map[string]*NodeInfo
- func (rs *RegistryServer) RegisterController(ctx context.Context, req *registry.RegisterControllerRequest) (*registry.RegisterControllerReply, error)
- func (rs *RegistryServer) RegisterService(rpcServer *grpc.Server)
- func (rs *RegistryServer) UnregisterController(ctx context.Context, req *registry.UnregisterControllerRequest) (*registry.UnregisterControllerReply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RegistryListener ¶
type RegistryListener interface { // OnNodeAdded is called by RegistryServer whenever a new node controller is registered // or node controller updated its endpoint. // In case of error, the node registration would fail and removed from registry. OnNodeAdded(ctx context.Context, node *NodeInfo) error // OnNodeDeleted is called by RegistryServer whenever a node controller unregistered. // Callback implementations has to note that by the time this method is called, // the NodeInfo for that node have already removed from in-memory registry. OnNodeDeleted(ctx context.Context, node *NodeInfo) }
RegistryListener is an interface for registry server change listeners All the callbacks are called once after updating the in-memory registry data.
type RegistryServer ¶
type RegistryServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(tlsConfig *tls.Config) *RegistryServer
func (*RegistryServer) AddListener ¶
func (rs *RegistryServer) AddListener(l RegistryListener)
func (*RegistryServer) ConnectToNodeController ¶
func (rs *RegistryServer) ConnectToNodeController(nodeId string) (*grpc.ClientConn, error)
ConnectToNodeController initiates a connection to controller running at nodeId
func (*RegistryServer) GetNodeController ¶
func (rs *RegistryServer) GetNodeController(nodeID string) (NodeInfo, error)
GetNodeController returns the node controller info for given nodeID, error if not found
func (*RegistryServer) NodeClients ¶
func (rs *RegistryServer) NodeClients() map[string]*NodeInfo
NodeClients returns a new map which contains a copy of all currently known node clients. It is safe to use concurrently with the other methods.
func (*RegistryServer) RegisterController ¶
func (rs *RegistryServer) RegisterController(ctx context.Context, req *registry.RegisterControllerRequest) (*registry.RegisterControllerReply, error)
func (*RegistryServer) RegisterService ¶
func (rs *RegistryServer) RegisterService(rpcServer *grpc.Server)
func (*RegistryServer) UnregisterController ¶
func (rs *RegistryServer) UnregisterController(ctx context.Context, req *registry.UnregisterControllerRequest) (*registry.UnregisterControllerReply, error)
Click to show internal directories.
Click to hide internal directories.