Skip to content

Instantly share code, notes, and snippets.

@mantzas
Created June 4, 2019 19:34
Show Gist options
  • Save mantzas/b5fedc191412c510d7e29f87ddb652fd to your computer and use it in GitHub Desktop.
Save mantzas/b5fedc191412c510d7e29f87ddb652fd to your computer and use it in GitHub Desktop.
harvester full
cfg := config{}
ii := []consul.Item{consul.NewKeyItem("harvester/example_03/balance")}
h, err := harvester.New(&cfg).
WithConsulSeed("127.0.0.1:8500", "", "", 0).
WithConsulMonitor("127.0.0.1:8500", "", "", 0, ii...).
Create()
if err != nil {
log.Fatalf("failed to create harvester: %v", err)
}
err = h.Harvest(ctx)
if err != nil {
log.Fatalf("failed to harvest configuration: %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment