Documentation
¶
Index ¶
- Constants
- func AddServiceInstance(in *ServiceInstance) error
- func BroadcastEvent(event string, data any) error
- func ConnectService(in *ServiceInstance) (*grpc.ClientConn, error)
- func GetClientId(ctx context.Context) (string, error)
- func GetServiceStatus() map[string]bool
- func RemoveServiceInstance(id string) error
- func ValidateServices()
- type ServiceInstance
- type ServiceRpcServer
- func (v *ServiceRpcServer) AddService(ctx context.Context, info *proto.ServiceInfo) (*proto.AddServiceResponse, error)
- func (v *ServiceRpcServer) BroadcastEvent(ctx context.Context, in *proto.EventInfo) (*proto.EventResponse, error)
- func (v *ServiceRpcServer) GetService(ctx context.Context, request *proto.GetServiceRequest) (*proto.GetServiceResponse, error)
- func (v *ServiceRpcServer) ListService(ctx context.Context, request *proto.ListServiceRequest) (*proto.ListServiceResponse, error)
- func (v *ServiceRpcServer) RemoveService(ctx context.Context, request *proto.RemoveServiceRequest) (*proto.RemoveServiceResponse, error)
Constants ¶
View Source
const ServiceInfoKvPrefix = "nexus.service/"
Variables ¶
This section is empty.
Functions ¶
func AddServiceInstance ¶
func AddServiceInstance(in *ServiceInstance) error
func BroadcastEvent ¶
func ConnectService ¶
func ConnectService(in *ServiceInstance) (*grpc.ClientConn, error)
func GetServiceStatus ¶
func RemoveServiceInstance ¶
func ValidateServices ¶
func ValidateServices()
Types ¶
type ServiceInstance ¶
type ServiceInstance struct { ID string `json:"id"` Type string `json:"type"` Label string `json:"label"` GrpcAddr string `json:"grpc_addr"` HttpAddr *string `json:"http_addr"` // contains filtered or unexported fields }
func GetServiceInstance ¶
func GetServiceInstance(id string) *ServiceInstance
func GetServiceInstanceByType ¶
func GetServiceInstanceByType(t string) *ServiceInstance
func ListServiceInstance ¶
func ListServiceInstance() []*ServiceInstance
func ListServiceInstanceByType ¶
func ListServiceInstanceByType(t string) []*ServiceInstance
func (*ServiceInstance) GetGrpcConn ¶
func (v *ServiceInstance) GetGrpcConn() (*grpc.ClientConn, error)
type ServiceRpcServer ¶
type ServiceRpcServer struct {
proto.UnimplementedDirectoryServiceServer
}
func (*ServiceRpcServer) AddService ¶
func (v *ServiceRpcServer) AddService(ctx context.Context, info *proto.ServiceInfo) (*proto.AddServiceResponse, error)
func (*ServiceRpcServer) BroadcastEvent ¶
func (v *ServiceRpcServer) BroadcastEvent(ctx context.Context, in *proto.EventInfo) (*proto.EventResponse, error)
func (*ServiceRpcServer) GetService ¶
func (v *ServiceRpcServer) GetService(ctx context.Context, request *proto.GetServiceRequest) (*proto.GetServiceResponse, error)
func (*ServiceRpcServer) ListService ¶
func (v *ServiceRpcServer) ListService(ctx context.Context, request *proto.ListServiceRequest) (*proto.ListServiceResponse, error)
func (*ServiceRpcServer) RemoveService ¶
func (v *ServiceRpcServer) RemoveService(ctx context.Context, request *proto.RemoveServiceRequest) (*proto.RemoveServiceResponse, error)
Click to show internal directories.
Click to hide internal directories.