github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/builtin/providers/profitbricks/config.go (about)

     1  package profitbricks
     2  
     3  import (
     4  	"github.com/profitbricks/profitbricks-sdk-go"
     5  )
     6  
     7  type Config struct {
     8  	Username string
     9  	Password string
    10  	Endpoint string
    11  	Retries  int
    12  }
    13  
    14  // Client() returns a new client for accessing ProfitBricks.
    15  func (c *Config) Client() (*Config, error) {
    16  	profitbricks.SetAuth(c.Username, c.Password)
    17  	profitbricks.SetDepth("5")
    18  	if len(c.Endpoint) > 0 {
    19  		profitbricks.SetEndpoint(c.Endpoint)
    20  	}
    21  	return c, nil
    22  }