コード例 #1
0
func (c *Config) Client() (*bosh_client.Director, error) {

	b, err := bosh_client.NewDirector(context.Background(), c.Target, c.User, c.Password)
	if err != nil && err.Error() != "bosh director not found" {
		return nil, err
	}
	return b, nil
}
コード例 #2
0
func GetDirector() (*bosh_client.Director, error) {
	
	d, err := bosh_client.NewDirector(context.Background(), os.Getenv("BOSH_TARGET"), os.Getenv("BOSH_USER"), os.Getenv("BOSH_PASSWORD"))
	if err != nil {
		return nil, fmt.Errorf("error connecting to the bosh director: %s", err.Error())
	}
	
	return d, nil
}