Browse Source

cmd/mconnect-discover: simple tool to perform discovery

bboozzoo/golang
Maciek Borzecki 7 years ago
parent
commit
7d9eac9c0b
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      cmd/mconnect-discover/main.go

+ 32
- 0
cmd/mconnect-discover/main.go View File

@ -0,0 +1,32 @@
package main
import (
"context"
"fmt"
"os"
"github.com/bboozzoo/mconnect/discovery"
"github.com/bboozzoo/mconnect/logger"
)
var Stderr = os.Stderr
func main() {
ctx := context.Background()
ctx = logger.WithContext(ctx, logger.New())
log := logger.FromContext(ctx)
log.Printf("setting up listener")
l, err := discovery.NewListener()
if err != nil {
fmt.Fprintf(Stderr, "error: failed to setup listener: %v\n",
err)
os.Exit(1)
}
for {
log.Printf("receive wait")
l.Receive(ctx)
}
}

Loading…
Cancel
Save