Skip to content

Instantly share code, notes, and snippets.

@simt2
Created February 21, 2017 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simt2/4366d7db80ce7c40bce3badc7999582d to your computer and use it in GitHub Desktop.
Save simt2/4366d7db80ce7c40bce3badc7999582d to your computer and use it in GitHub Desktop.
mesh-go-example LoadChildren.go
// LoadChildren takes a nodes uuid and returns its children.
func LoadChildren(uuid string) *[]gjson.Result {
r := MeshGetRequest("demo/nodes/" + uuid + "/children?expandAll=true&resolveLinks=short")
defer r.Body.Close()
bytes, _ := ioutil.ReadAll(r.Body)
json := gjson.ParseBytes(bytes).Get("data").Array()
return &json
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment