github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/provider/vsphere/init.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package vsphere
     5  
     6  import (
     7  	"context"
     8  	"net/url"
     9  
    10  	"github.com/juju/juju/environs"
    11  	"github.com/juju/juju/provider/vsphere/internal/vsphereclient"
    12  )
    13  
    14  const (
    15  	providerType = "vsphere"
    16  )
    17  
    18  func init() {
    19  	dial := func(ctx context.Context, u *url.URL, dc string) (Client, error) {
    20  		return vsphereclient.Dial(ctx, u, dc, logger)
    21  	}
    22  	environs.RegisterProvider(providerType, NewEnvironProvider(EnvironProviderConfig{
    23  		Dial: dial,
    24  	}))
    25  }