// NewSerfSubsys initializes and return a SerfSubsys instance func NewSerfSubsys(config *client.Config) *SerfSubsys { //XXX: make a copy of the config as the serf client changes the config c := *config sm := &SerfSubsys{ config: &c, router: serfer.NewRouter(), } return sm }
func main() { r := serfer.NewRouter() r.AddMemberJoinHandler(handleJoin) sr := r.NewSubRouter("events/") sr.AddHandler("foo", handleFoo) if err := r.InitSerfAndServe(""); err != nil { log.Fatalf("Failed to initialize serfer. Error: %s", err) } }