This commit is contained in:
kzkzzzz
2025-03-22 01:24:57 +08:00
parent 197476e805
commit 7e0bf82418
22 changed files with 2291 additions and 919 deletions

21
myregistry/reigster.go Normal file
View File

@@ -0,0 +1,21 @@
package myregistry
import "fmt"
type ServiceInfo struct {
ServiceName string
Ip string
Port int
Extend map[string]string
}
func (s *ServiceInfo) String() string {
return fmt.Sprintf("%s - %s:%d", s.ServiceName, s.Ip, s.Port)
}
// IRegister 注册中心 服务注册发现
type IRegister interface {
Name() string
Register(service *ServiceInfo) error
Deregister(service *ServiceInfo) error
}