blob: a35242cf06a14f310063577bcea6d89c14ee1eb9 [file] [log] [blame]
Samuel A. Falvo IIfd78c302013-06-25 16:35:32 -07001package gophercloud
2
Samuel A. Falvo II5d0d74c2013-06-25 17:23:18 -07003import (
4 "net/http"
5)
6
Samuel A. Falvo IIfd78c302013-06-25 16:35:32 -07007type Context struct {
Samuel A. Falvo II5d0d74c2013-06-25 17:23:18 -07008 // providerMap serves as a directory of supported providers.
Samuel A. Falvo IIfd78c302013-06-25 16:35:32 -07009 providerMap map[string]*Provider
Samuel A. Falvo II5d0d74c2013-06-25 17:23:18 -070010
11 // httpClient refers to the current HTTP client interface to use.
12 httpClient *http.Client
Samuel A. Falvo IIfd78c302013-06-25 16:35:32 -070013}
14
15func TestContext() *Context {
16 return &Context{
17 providerMap: make(map[string]*Provider),
Samuel A. Falvo II5d0d74c2013-06-25 17:23:18 -070018 httpClient: &http.Client{},
Samuel A. Falvo IIfd78c302013-06-25 16:35:32 -070019 }
20}
Samuel A. Falvo II5d0d74c2013-06-25 17:23:18 -070021
22func (c *Context) UseCustomClient(hc *http.Client) {
23 c.httpClient = hc;
24}