diff options
| author | Jeff Carr <[email protected]> | 2024-01-03 12:40:31 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-03 12:40:31 -0600 |
| commit | e14770e94c9ec126a3d418d6d2b2f15ef8cf1607 (patch) | |
| tree | 12b223cbe9cb9c6ef98b23d8bf6ae96e2040b3d7 /digitalocean/api.go | |
| parent | 1324717de0a1ccd830ca34aa03e0faa9e6d93a83 (diff) | |
fixed stuff
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'digitalocean/api.go')
| -rw-r--r-- | digitalocean/api.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/digitalocean/api.go b/digitalocean/api.go deleted file mode 100644 index b1568b1..0000000 --- a/digitalocean/api.go +++ /dev/null @@ -1,36 +0,0 @@ -package digitalocean - -import ( - "context" - - "golang.org/x/oauth2" - "github.com/digitalocean/godo" - - "go.wit.com/log" -) - -func (d *DigitalOcean) listRegions() []godo.Region { - tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: d.token}) - oauthClient := oauth2.NewClient(context.Background(), tokenSource) - client := godo.NewClient(oauthClient) - - ctx := context.TODO() - - // Retrieve all regions. - regions, _, err := client.Regions.List(ctx, &godo.ListOptions{}) - if err != nil { - d.err = err - log.Warn(err, "digitalocean.listRegions() failed") - return nil - } - - /* - // Print details of each region. - fmt.Println("Available Regions:") - for _, region := range regions { - fmt.Printf("Slug: %s, Name: %s, Available: %v\n", region.Slug, region.Name, region.Available) - } - */ - - return regions -} |
