github.com/recobe182/terraform@v0.8.5-0.20170117231232-49ab22a935b7/builtin/providers/ultradns/config.go (about) 1 package ultradns 2 3 import ( 4 "fmt" 5 "log" 6 7 "github.com/Ensighten/udnssdk" 8 ) 9 10 // Config collects the connection service-endpoint and credentials 11 type Config struct { 12 Username string 13 Password string 14 BaseURL string 15 } 16 17 // Client returns a new client for accessing UltraDNS. 18 func (c *Config) Client() (*udnssdk.Client, error) { 19 client, err := udnssdk.NewClient(c.Username, c.Password, c.BaseURL) 20 21 if err != nil { 22 return nil, fmt.Errorf("Error setting up client: %s", err) 23 } 24 25 log.Printf("[INFO] UltraDNS Client configured for user: %s", c.Username) 26 27 return client, nil 28 }