You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
641 B

package main
import (
"flag"
)
type config struct {
RendezvousString string
ProtocolID string
listenHost string
listenPort int
}
func parseFlags() *config {
c := &config{}
flag.StringVar(&c.RendezvousString, "rendezvous", "meetme", "Unique string to identify group of nodes. Share this with your friends to let them connect with you")
flag.StringVar(&c.listenHost, "host", "0.0.0.0", "The bootstrap node host listen address\n")
flag.StringVar(&c.ProtocolID, "pid", "/chat/1.1.0", "Sets a protocol id for stream headers")
flag.IntVar(&c.listenPort, "port", 4001, "node listen port")
flag.Parse()
return c
}