服务发现基础逻辑
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user