Getting Started
Example using packaged OAuth2 Client Helper
clientID := os.Getenv("DOMO_CLIENT_ID")
clientSecret := os.Getenv("DOMO_SECRET")
auth := domo.NewAuthenticator(domo.ScopeData)
auth.SetAuthInfo(clientID, clientSecret) // It defaults to using the same ENV Vars so this is potentially Optional
client := auth.NewClient()
ctx := context.Background()
data, _, err := client.Datasets.List(ctx, 5, 0)
if err != nil {
fmt.Println("error domo dataset")
}
for _, ds := range data {
out := fmt.Sprintf("DomoDomo Dataset name: %s, ID: %s", ds.Name, ds.ID)
fmt.Println(out)
}
Example using your own http client with OAuth2 configured on it
client := domo.NewClient(YourClient)
ctx := context.Background()
data, _, err := client.Datasets.List(ctx, 5, 0)
if err != nil {
fmt.Println("error domo dataset")
}
for _, ds := range data {
out := fmt.Sprintf("DomoDomo Dataset name: %s, ID: %s", ds.Name, ds.ID)
fmt.Println(out)
}
TODO: