module
Version:
v0.0.0-...-e2d844a
Opens a new window with list of versions in this module.
Published: May 30, 2014
License: Apache-2.0
Opens a new window with license information.
README
¶
etcdns
Extended Go net
dialing with DNS caching backed by etcd a highly-available key value store.
example
Service discovery using etcdns:
import (
net "github.com/crackcomm/etcdns/net"
)
// on server & client
func init() {
net.SetCluster([]string{"etcd.com:4001"})
}
func server() {
go net.Register("secret.service", []string{"10.0.0.1:5051"}) // register service in etcd
http.ListenAndServe("10.0.0.1:5051", nil) // start listening for connections
}
func client() {
conn, err := net.Dial("tcp", "secret.service")
if err != nil {
fmt.Printf("Error dialing secret.service")
}
defer conn.Close()
// we are now connected to 10.0.0.1:5051
}
godoc
godoc
Directories
¶
Extended net dialing using https://github.com/coreos/etcd a highly-available key value store.
|
Extended net dialing using https://github.com/coreos/etcd a highly-available key value store. |
Click to show internal directories.
Click to hide internal directories.