directory

package
v0.0.0-...-8ac8841 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceInfoKvPrefix = "nexus.service/"

Variables

This section is empty.

Functions

func AddServiceInstance

func AddServiceInstance(in *ServiceInstance) error

func BroadcastEvent

func BroadcastEvent(event string, data any) error

func ConnectService

func ConnectService(in *ServiceInstance) (*grpc.ClientConn, error)

func GetClientId

func GetClientId(ctx context.Context) (string, error)

func GetServiceStatus

func GetServiceStatus() map[string]bool

func RemoveServiceInstance

func RemoveServiceInstance(id string) error

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 (*ServiceRpcServer) BroadcastEvent

func (v *ServiceRpcServer) BroadcastEvent(ctx context.Context, in *proto.EventInfo) (*proto.EventResponse, error)

func (*ServiceRpcServer) GetService

func (*ServiceRpcServer) ListService

func (*ServiceRpcServer) RemoveService

Jump to

Keyboard shortcuts

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