register

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const InstanceTypeGRPC = "GRPC"
View Source
const InstanceTypeHttp = "HTTP"

Variables

This section is empty.

Functions

func GetServerId

func GetServerId(serverName string, instanceType string) string

func GetServerName

func GetServerName(serverName string, instanceType string) string

Types

type Register

type Register interface {
	Register(ctx context.Context, serviceInstance *ServiceInstance) error
	DeRegister(ctx context.Context, serviceInstance *ServiceInstance) error
	List(ctx context.Context, serviceName string) ([]*ServiceInstance, error)
	Subscribe(ctx context.Context, serviceName string) (<-chan *ServiceInstance, error)
}

type ServiceInstance

type ServiceInstance struct {
	ID      string
	Name    string
	Address string
	Port    int
	Type    string
}

func NewServiceInstance

func NewServiceInstance(serverName, address string, port int, instanceType string) *ServiceInstance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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