Exemple #1
0
func (p *awsProvider) Env() *env.EnvSet {
	var envSet = env.NewEnvSet("aws")
	envSet.Secret("AWS_ACCESS_KEY", "access key for AWS")
	envSet.Secret("AWS_SECRET_KEY", "secret key for AWS")
	envSet.String("AWS_AVAILABILITY_ZONE", "", "availability zone for AWS; eg: us-west-2a")
	return envSet
}
Exemple #2
0
package digitalocean

import (
	"fmt"
	"path/filepath"
	"strconv"
	"strings"
	"time"

	"github.com/MattAitchison/env"
	"github.com/digitalocean/godo"
	"github.com/gliderlabs/hostctl/providers"
	"golang.org/x/oauth2"
)

var envSet = env.NewEnvSet("digitalocean")

func init() {
	readEnv()
	providers.Register(new(digitalOceanProvider), "digitalocean")
}

func readEnv() {
	envSet.Clear()
	envSet.Secret("DO_TOKEN", "token for DigitalOcean API v2")
}

type digitalOceanProvider struct {
	client *godo.Client
}