func NewCharmDownloader(apiCaller base.APICaller) *downloader.Downloader {
	dlr := &downloader.Downloader{
		OpenBlob: func(url *url.URL) (io.ReadCloser, error) {
			curl, err := charm.ParseURL(url.String())
			if err != nil {
				return nil, errors.Annotate(err, "did not receive a valid charm URL")
			}
			reader, err := OpenCharm(apiCaller, curl)
			if err != nil {
				return nil, errors.Trace(err)
			}
			return reader, nil
		},
	}
	return dlr
}
// NewCharmDownloader returns a new charm downloader that wraps the
// provided API caller.
NewCharmDownloader returns a new charm downloader that wraps the
provided API caller.
// NewCharmDownloader returns a new charm downloader that wraps the // provided API caller .
func NewCharmDownloader(apiCaller base.APICaller) *downloader.Downloader {
	dlr := &downloader.Downloader{
		OpenBlob: func(url *url.URL) (io.ReadCloser, error) {
			curl, err := charm.ParseURL(url.String())
			if err != nil {
				return nil, errors.Annotate(err, "did not receive a valid charm URL")
			}
			reader, err := OpenCharm(apiCaller, curl)
			if err != nil {
				return nil, errors.Trace(err)
			}
			return reader, nil
		},
	}
	return dlr
}
func NewCharmDownloader ( apiCaller base . APICaller ) * downloader . Downloader { dlr := & downloader . Downloader { OpenBlob : func ( url * url . URL ) ( io . ReadCloser , error ) { curl , err := charm . ParseURL ( url . String ( ) ) if err != nil { return nil , errors . Annotate ( err , " " ) } reader , err := OpenCharm ( apiCaller , curl ) if err != nil { return nil , errors . Trace ( err ) } return reader , nil } , } return dlr }
NewCharmDownloader returns a new charm downloader that wraps the
provided API caller.
NewCharmDownloader returns a new charm downloader that wraps the provided API caller .