Created
September 5, 2018 16:04
-
-
Save ofonimefrancis/55702fbcc32293c0d60ed5d9645f8cf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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