服务发现基础逻辑

This commit is contained in:
2024-10-12 00:38:18 +08:00
parent d1d7f56ce4
commit e6f5aaa02f
10 changed files with 216 additions and 31 deletions
-1
View File
@@ -48,7 +48,6 @@ func (s *zeroconfService) FindService() (chan *models.Online, error) {
go func(results <-chan *zeroconf.ServiceEntry) {
for entry := range results {
if entry.ServiceInstanceName() == fmt.Sprintf("%s._http._tcp.local.", cfg.T.ZeroconfKey) {
//fmt.Printf("发现服务: %s \nIP:%s:%d \nInfo: %v\n", entry.ServiceInstanceName(), entry.AddrIPv4, entry.Port, entry.Text)
online, err := models.NewOnline(entry)
if err != nil {
continue