blob: f2249c3e60e02b4200685710729f3bb9c86e92b7 [file] [log] [blame]
package gophercloud
import (
)
type Provider struct {
// empty.
}
var providerMap = make(map[string]*Provider)
func (c *Context) RegisterProvider(name string, p *Provider) error {
c.providerMap[name] = p
return nil
}
func (c *Context) ProviderByName(name string) (p *Provider, err error) {
for provider, descriptor := range c.providerMap {
if name == provider {
return descriptor, nil
}
}
return nil, ErrProvider
}