func (t *TargetPlugin) SetConfig(config map[string]string) error {
	t.config = config
	token, ok := config[configKeyToken]
	if ok {
		contents, err := pathOrContents(token)
		if err != nil {
			return fmt.Errorf("failed to read token: %v", err)
		}
		t.client = godo.NewFromToken(contents)
	} else {
		tokenFromEnv := getEnv("DIGITALOCEAN_TOKEN", "DIGITALOCEAN_ACCESS_TOKEN")
		if len(tokenFromEnv) == 0 {
			return fmt.Errorf("unable to find DigitalOcean token")
		}
		t.client = godo.NewFromToken(tokenFromEnv)
	}
	clusterUtils, err := scaleutils.NewClusterScaleUtils(nomad.ConfigFromNamespacedMap(config), t.logger)
	if err != nil {
		return err
	}
	t.clusterUtils = clusterUtils
	t.clusterUtils.ClusterNodeIDLookupFunc = doDropletNodeIDMap
	return nil
}
SetConfig satisfies the SetConfig function on the base.Base interface.
package plugin
import (
	"context"
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"github.com/digitalocean/godo"
	"github.com/hashicorp/go-hclog"
	"github.com/hashicorp/nomad-autoscaler/plugins"
	"github.com/hashicorp/nomad-autoscaler/plugins/base"
	"github.com/hashicorp/nomad-autoscaler/plugins/target"
	"github.com/hashicorp/nomad-autoscaler/sdk"
	"github.com/hashicorp/nomad-autoscaler/sdk/helper/nomad"
	"github.com/hashicorp/nomad-autoscaler/sdk/helper/scaleutils"
	"github.com/mitchellh/go-homedir"
)
const (
	pluginName = "do-droplets"
	configKeyToken      = "token"
	configKeyRegion     = "region"
	configKeySize       = "size"
	configKeyVpcUUID    = "vpc_uuid"
	configKeySnapshotID = "snapshot_id"
	configKeySshKeys    = "ssh_keys"
	configKeyUserData   = "user_data"
	configKeyName       = "name"
	configKeyTags       = "tags"
)
var (
	PluginConfig = &plugins.InternalPluginConfig{
		Factory: func(l hclog.Logger) interface{} { return NewDODropletsPlugin(l) },
	}
	pluginInfo = &base.PluginInfo{
		Name:       pluginName,
		PluginType: sdk.PluginTypeTarget,
	}
)
var _ target.Target = (*TargetPlugin)(nil)
type TargetPlugin struct {
	config map[string]string
	logger hclog.Logger
	client *godo.Client
	clusterUtils *scaleutils.ClusterScaleUtils
}
func NewDODropletsPlugin(log hclog.Logger) *TargetPlugin {
	return &TargetPlugin{
		logger: log,
	}
}
func (t *TargetPlugin) PluginInfo() (*base.PluginInfo, error) {
	return pluginInfo, nil
}