Documentation ¶
Index ¶
- Variables
- func Delete(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func Get(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func GetJSON(url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- func Post(url string, params *url.Values, headers *http.Header, body *[]byte) (resp *http.Response, err error)
- func PostJSON(url string, params *url.Values, headers *http.Header, body interface{}, ...) (resp *http.Response, err error)
- func Put(url string, params *url.Values, headers *http.Header, body *[]byte) (resp *http.Response, err error)
- type AccessType
- type AuthFunc
- type AuthOpts
- type AuthRef
- type AuthToken
- type OSAuth
- type PasswordCredentials
- type Response
- type ServiceCatalogEntry
- type ServiceEndpoint
- type Session
- func (s *Session) Delete(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func (s *Session) Do(req *http.Request) (*http.Response, error)
- func (s *Session) Get(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func (s *Session) GetJSON(url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- func (s *Session) Head(url string, params *url.Values, headers *http.Header) (resp *http.Response, err error)
- func (s *Session) NewRequest(method, url string, headers *http.Header, body io.Reader) (req *http.Request, err error)
- func (s *Session) Post(url string, params *url.Values, headers *http.Header, body *[]byte) (resp *http.Response, err error)
- func (s *Session) PostJSON(url string, params *url.Values, headers *http.Header, body interface{}, ...) (resp *http.Response, err error)
- func (s *Session) Put(url string, params *url.Values, headers *http.Header, body *[]byte) (resp *http.Response, err error)
- func (s *Session) Request(method string, url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- func (s *Session) RequestJSON(method string, url string, params *url.Values, headers *http.Header, ...) (resp *http.Response, err error)
- type Token
- type UserPassV2
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = new(bool)
Functions ¶
func Delete ¶
func Delete( url string, params *url.Values, headers *http.Header, ) (resp *http.Response, err error)
Delete sends a DELETE request.
func GetJSON ¶
func GetJSON( url string, params *url.Values, headers *http.Header, responseContainer interface{}, ) (resp *http.Response, err error)
GetJSON sends a GET request and unmarshalls returned JSON.
func Post ¶
func Post( url string, params *url.Values, headers *http.Header, body *[]byte, ) (resp *http.Response, err error)
Post sends a POST request.
Types ¶
type AccessType ¶
type AccessType struct { Token Token `json:"token"` User interface{} `json:"user"` ServiceCatalog []ServiceCatalogEntry `json:"servicecatalog"` }
type AuthOpts ¶
type AuthOpts struct { // AuthUrl is always required AuthUrl string // Domain is ignored for v2 and required for v3 auth Domain string // Project is optional to get an unscoped token but required for // a scoped token, which is required to do pretty much everything // except list projects ProjectName string ProjectId string // Username is required for password auth Username string // Password is required for password auth Password string // Token is required for Toekn auth Token string }
AuthOpts is the set of credentials used to authenticate to OpenStack
func (*AuthOpts) GetAuthType ¶
type AuthRef ¶
type AuthRef interface { GetToken() string GetExpiration() time.Time GetEndpoint(string, string) (string, error) GetProject() string GetProjectId() string }
AuthRef is the returned authentication object, maybe v2 or v3
func DoAuthRequest ¶
Basic auth call These args should be an interface??
type AuthToken ¶
type AuthToken struct {
Access AccessType `json:"access"`
}
func (AuthToken) GetEndpoint ¶
func (AuthToken) GetExpiration ¶
func (AuthToken) GetProject ¶
func (AuthToken) GetProjectId ¶
type OSAuth ¶
type OSAuth struct { PasswordCredentials `json:"passwordCredentials"` ProjectName string `json:"tenantName"` ProjectId string `json:"tenantId"` }
type PasswordCredentials ¶
type ServiceCatalogEntry ¶
type ServiceCatalogEntry struct { Name string `json:"name"` Type string `json:"type"` Endpoints []ServiceEndpoint `json:"endpoints"` }
func (ServiceCatalogEntry) GetEndpoint ¶
func (sce ServiceCatalogEntry) GetEndpoint( serviceType string, interfaceType string, regionName string, ) (string, error)
Valid interfaceType values: 'public', 'publicURL', 'admin', 'admin URL', 'internal', 'internalURL'
type ServiceEndpoint ¶
type Session ¶
type Session struct { AuthToken AuthRef Headers http.Header // contains filtered or unexported fields }
func NewSession ¶
func (*Session) NewRequest ¶
type UserPassV2 ¶
func NewUserPassV2 ¶
func NewUserPassV2(ao AuthOpts) (upv2 *UserPassV2, err error)
Click to show internal directories.
Click to hide internal directories.