func (d *Driver) getClient() *vultr.Client { log.Infof("getting client") if d.client == nil { d.client = vultr.NewClient(d.APIKey, nil) } return d.client }
func (d *Driver) getClient() *vultr.Client { if d.client == nil { d.client = vultr.NewClient(d.APIKey, &vultr.Options{MaxRetries: clientMaxRetries}) } return d.client }
// Client() returns a new client for accessing Vultr. func (c *Config) Client() (*lib.Client, error) { client := lib.NewClient( c.ApiKey, &lib.Options{ UserAgent: fmt.Sprintf("vultr-go/%s terraform", lib.Version)}) log.Printf("[INFO] Vultr Client configured for URL: %s", client.Endpoint) return client, nil }
// NewDNSProviderCredentials uses the supplied credentials to return a DNSProvider // instance configured for Vultr. func NewDNSProviderCredentials(apiKey string) (*DNSProvider, error) { if apiKey == "" { return nil, fmt.Errorf("Vultr credentials missing") } c := &DNSProvider{ client: vultr.NewClient(apiKey, nil), } return c, nil }