Skip to content

digitalocean/go-metadata

Repository files navigation

metadata Documentation

A Go client to interact with the DigitalOcean Metadata API.

Usage

// Create a client
client := metadata.NewClient(opts)

// Request all the metadata about the current droplet
all, err := client.Metadata()
if err != nil {
    log.Fatal(err)
}

// Lookup what our IPv4 address is on our first public
// network interface.
publicIPv4Addr := all.Interfaces["public"][0].IPv4.IPAddress

fmt.Println(publicIPv4Addr)

License

MIT license

About

Go client for the metadata API.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages