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 ¶
Functions ¶
func Delete ¶
func Delete( url string, params *url.Values, headers *http.Header, ) (resp *http.Response, err error)
Delete sends a DELETE request.
func Get ¶
Get sends a GET 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 AuthFunc ¶
Generic callback to get a token from the auth plugin
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
type AuthRef ¶
type AuthRef interface {
GetToken() string
GetExpiration() time.Time
GetEndpoint(string, string) (string, error)
GetProject() string
}
AuthRef is the returned authentication object, maybe v2 or v3
type AuthToken ¶
type AuthToken struct {
Access AccessType `json:"access"`
}
func (AuthToken) GetEndpoint ¶
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"`
}
type ServiceEndpoint ¶
type Session ¶
type Session struct {
AuthToken AuthRef
Headers http.Header
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) Delete ¶
func (*Session) Get ¶
func (*Session) GetJSON ¶
func (*Session) Head ¶
func (*Session) NewRequest ¶
func (*Session) Post ¶
func (*Session) PostJSON ¶
func (*Session) Put ¶
type Token ¶
type UserPassV2 ¶
func NewUserPassV2 ¶
func NewUserPassV2(ao AuthOpts) (upv2 *UserPassV2, err error)
Source Files
¶
- auth-password.go
- auth-token.go
- auth.go
- service-catalog.go
- session.go
Click to show internal directories.
Click to hide internal directories.