Skip to content

andy-trimble/go.discovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-discovery

Muticast Discovery for Golang. This library is compatible with the Java impelemtation found here https://github.com/andy-trimble/discovery.

Build Status

See the example for usage. Here's a basic example:

d := discovery.Discovery{}
err := d.Start("server")
if err != nil {
	log.Fatal(err)
}
defer d.Shutdown()

go func() {
	for {
		actor := <-d.Discovered
		log.Printf("Discovered %+v", actor)
	}
}()

for {
	err := <-d.Err
	log.Printf("%+v", err)
}

The configuration options are specified by environment variables. The variables that can be set are as follows:

DISCOVERY_INTERFACE - The network interface to utilize - default: eth0
DISCOVERY_GROUP - The multicast group - default: 230.1.1.1
DISCOVERY_PORT - The multicast port - default: 8989
DISCOVERY_ANNOUNCE_COUNT - The number of times to announce oneself - default: 5
DISCOVERY_ANNOUNCE_WAIT - The duration between subsequent announcements - default: 500 ms

About

Muticast Discovery for Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages