Documentation ¶
Index ¶
- Variables
- func Get(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 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) 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) 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)
- type Token
- type UserPassV2
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = new(bool)
Functions ¶
Types ¶
type AccessType ¶
type AccessType struct { Token Token `json:"token"` User interface{} `json:"id"` 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 Project 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) }
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 ¶
type OSAuth ¶
type OSAuth struct { PasswordCredentials `json:"passwordCredentials"` Project string `json:"tenantName"` }
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) NewRequest ¶
type UserPassV2 ¶
func NewUserPassV2 ¶
func NewUserPassV2(ao AuthOpts) (upv2 *UserPassV2, err error)
Click to show internal directories.
Click to hide internal directories.