github.com/binkynet/BinkyNet@v1.12.1-0.20240421190447-da4e34c20be0/discovery/test/main.go (about) 1 package main 2 3 import ( 4 "context" 5 "os" 6 7 api "github.com/binkynet/BinkyNet/apis/v1" 8 "github.com/binkynet/BinkyNet/discovery" 9 "github.com/rs/zerolog" 10 ) 11 12 var ( 13 log = zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() 14 ) 15 16 func main() { 17 nmListener := discovery.NewServiceListener(log, api.ServiceTypeLogProvider, true, onChange) 18 nmListener.Run(context.Background()) 19 } 20 21 func onChange(info api.ServiceInfo) { 22 23 }