Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 650 Bytes

File metadata and controls

29 lines (22 loc) · 650 Bytes

DO Metadata

godocs.io

This package implements a simple way to retrieve droplet metadata from the relevant digitalocean endpoint.

Example

package main

import (
	do_metadata "github.com/codegaudi/do-metadata"
	"log"
	"time"
)

func main() {

    meta, err := do_metadata.RetrieveMetadata(time.Second * 5)
    if err != nil {
        log.Fatal("could not retrieve metadata from the digitalocean metadata api: ", err.Error())
    }
    
    // Print the droplet id
    log.Print(meta.DropletID)
}

License

MIT