github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/builtin/providers/dyn/config.go (about) 1 package dyn 2 3 import ( 4 "fmt" 5 "log" 6 7 "github.com/nesv/go-dynect/dynect" 8 ) 9 10 type Config struct { 11 CustomerName string 12 Username string 13 Password string 14 } 15 16 // Client() returns a new client for accessing dyn. 17 func (c *Config) Client() (*dynect.ConvenientClient, error) { 18 client := dynect.NewConvenientClient(c.CustomerName) 19 err := client.Login(c.Username, c.Password) 20 21 if err != nil { 22 return nil, fmt.Errorf("Error setting up Dyn client: %s", err) 23 } 24 25 log.Printf("[INFO] Dyn client configured for customer: %s, user: %s", c.CustomerName, c.Username) 26 27 return client, nil 28 }