Name: go-metadata
Owner: DigitalOcean
Description: Go client for the metadata API.
Created: 2015-09-17 15:30:08.0
Updated: 2018-03-13 08:46:44.0
Pushed: 2018-01-11 00:21:17.0
Homepage: null
Size: 14
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Go client to interact with the DigitalOcean Metadata API.
reate a client
nt := metadata.NewClient(opts)
equest all the metadata about the current droplet
err := client.Metadata()
rr != nil {
log.Fatal(err)
ookup what our IPv4 address is on our first public
etwork interface.
icIPv4Addr := all.Interfaces["public"][0].IPv4.IPAddress
Println(publicIPv4Addr)
MIT license