Name: go-rancher-metadata
Owner: Rancher
Description: Go Bindings for Rancher-metadata service
Created: 2015-10-15 18:12:02.0
Updated: 2017-11-04 18:41:34.0
Pushed: 2018-03-14 20:57:55.0
Homepage: null
Size: 71
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This library is incomplete, but implements a variety of calls against rancher-metadata service
age main
rt (
"time"
"github.com/Sirupsen/logrus"
"github.com/rancher/go-rancher-metadata/metadata"
t (
metadataUrl = "http://rancher-metadata/2015-12-19"
main() {
:= metadata.NewClient(metadataUrl)
rsion := "init"
for {
newVersion, err := m.GetVersion()
if err != nil {
logrus.Errorf("Error reading metadata version: %v", err)
} else if version == newVersion {
logrus.Debug("No changes in metadata version")
} else {
logrus.Debugf("Metadata Version has been changed. Old version: %s. New version: %s.", version, newVersion)
version = newVersion
}
time.Sleep(5 * time.Second)
}