func NewClientStore(config ClientStoreConfig, dialOptions ...api.DialOption) (*ClientStoreConnector, error) {
	if config.ControllerName == "" {
		return nil, ErrEmptyControllerName
	}
	if config.ClientStore == nil {
		config.ClientStore = jujuclient.NewFileClientStore()
	}
	if config.AccountDetails == nil {
		d, err := config.ClientStore.AccountDetails(config.ControllerName)
		if err != nil {
			return nil, err
		}
		config.AccountDetails = d
	}
	conn := &ClientStoreConnector{
		config:          config,
		defaultDialOpts: api.DefaultDialOpts(),
	}
	for _, opt := range dialOptions {
		opt(&conn.defaultDialOpts)
	}
	return conn, nil
}
// NewClientStore returns a new *ClientStoreConnector instance for the given config, or an error if
// there was a problem setting up the connector.
NewClientStore returns a new *ClientStoreConnector instance for the given config, or an error if
there was a problem setting up the connector.
// NewClientStore returns a new * ClientStoreConnector instance for the given config or an error if // there was a problem setting up the connector .
func NewClientStore(config ClientStoreConfig, dialOptions ...api.DialOption) (*ClientStoreConnector, error) {
	if config.ControllerName == "" {
		return nil, ErrEmptyControllerName
	}
	if config.ClientStore == nil {
		config.ClientStore = jujuclient.NewFileClientStore()
	}
	if config.AccountDetails == nil {
		d, err := config.ClientStore.AccountDetails(config.ControllerName)
		if err != nil {
			return nil, err
		}
		config.AccountDetails = d
	}
	conn := &ClientStoreConnector{
		config:          config,
		defaultDialOpts: api.DefaultDialOpts(),
	}
	for _, opt := range dialOptions {
		opt(&conn.defaultDialOpts)
	}
	return conn, nil
}
func NewClientStore ( config ClientStoreConfig , dialOptions ... api . DialOption ) ( * ClientStoreConnector , error ) { if config . ControllerName == " " { return nil , ErrEmptyControllerName } if config . ClientStore == nil { config . ClientStore = jujuclient . NewFileClientStore ( ) } if config . AccountDetails == nil { d , err := config . ClientStore . AccountDetails ( config . ControllerName ) if err != nil { return nil , err } config . AccountDetails = d } conn := & ClientStoreConnector { config : config , defaultDialOpts : api . DefaultDialOpts ( ) , } for _ , opt := range dialOptions { opt ( & conn . defaultDialOpts ) } return conn , nil }
NewClientStore returns a new *ClientStoreConnector instance for the given config, or an error if
there was a problem setting up the connector.
NewClientStore returns a new * ClientStoreConnector instance for the given config or an error if there was a problem setting up the connector .