Skip to content

Instantly share code, notes, and snippets.

@ofonimefrancis
Created September 5, 2018 16:04
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 ofonimefrancis/55702fbcc32293c0d60ed5d9645f8cf9 to your computer and use it in GitHub Desktop.
Save ofonimefrancis/55702fbcc32293c0d60ed5d9645f8cf9 to your computer and use it in GitHub Desktop.
func retrieveUserOrders(influxClient client.Client, userID string) {
query := client.Query{
Command: fmt.Sprintf("select * from orders where user_id = '%s'", userID),
Database: "tutorial",
}
resp, err := influxClient.Query(query)
if err != nil {
log.Fatalf("%v", err)
}
log.Printf("%v", resp.Results[0].Series[0].Values[0][1].(json.Number))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment