Connect to a database using a STATSD_URL
.
It uses Statsd under the hood:
import "github.com/josegonzalez/go-statsdurl"
// Connect using os.Getenv("STATSD_URL").
c, err := statsdurl.Connect()
// Alternatively, connect using a custom Database URL.
c, err := statsdurl.ConnectToURL("udp://...")
In both cases you will get the result values of calling
statsd.NewStatsdClient(...)
, that is, an instance of statsd.StatsdClient
and an
error.
Install it using the "go get" command:
go get github.com/josegonzalez/go-statsdurl