Versions in this module Expand all Collapse all v0 v0.7.1 Dec 27, 2019 Changes in this version + const DefaultUserAgent + const RFC3339Milli + const RFC3339MilliNoZ + const RFC3339NoZ + const RFC3339ZNoT + const RFC3339ZNoTNoZ + func BuildHeaders(opts interface{}) (map[string]string, error) + func BuildQueryString(opts interface{}) (*url.URL, error) + func BuildRequestBody(opts interface{}, parent string) (map[string]interface{}, error) + func ExtractNextURL(links []Link) (string, error) + func IDSliceToQueryString(name string, ids []int) string + func IntToPointer(i int) *int + func IntWithinRange(val, min, max int) bool + func MaybeInt(original int) *int + func MaybeString(original string) *string + func NormalizePathURL(basePath, rawPath string) (string, error) + func NormalizeURL(url string) string + func WaitFor(timeout int, predicate func() (bool, error)) error + type AuthOptions struct + AllowReauth bool + ApplicationCredentialID string + ApplicationCredentialName string + ApplicationCredentialSecret string + DomainID string + DomainName string + IdentityEndpoint string + Password string + Scope *AuthScope + TenantID string + TenantName string + TokenID string + UserID string + Username string + func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[string]interface{}, error) + func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) + func (opts AuthOptions) CanReauth() bool + func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) + type AuthResult interface + ExtractTokenID func() (string, error) + type AuthScope struct + DomainID string + DomainName string + ProjectID string + ProjectName string + type Availability string + const AvailabilityAdmin + const AvailabilityInternal + const AvailabilityPublic + type BaseError struct + DefaultErrString string + Info string + func (e BaseError) Error() string + type EnabledState *bool + var Disabled EnabledState = &iFalse + var Enabled EnabledState = &iTrue + type EndpointLocator func(EndpointOpts) (string, error) + type EndpointOpts struct + Availability Availability + Name string + Region string + Type string + func (eo *EndpointOpts) ApplyDefaults(t string) + type Err400er interface + Error400 func(ErrUnexpectedResponseCode) error + type Err401er interface + Error401 func(ErrUnexpectedResponseCode) error + type Err403er interface + Error403 func(ErrUnexpectedResponseCode) error + type Err404er interface + Error404 func(ErrUnexpectedResponseCode) error + type Err405er interface + Error405 func(ErrUnexpectedResponseCode) error + type Err408er interface + Error408 func(ErrUnexpectedResponseCode) error + type Err409er interface + Error409 func(ErrUnexpectedResponseCode) error + type Err429er interface + Error429 func(ErrUnexpectedResponseCode) error + type Err500er interface + Error500 func(ErrUnexpectedResponseCode) error + type Err503er interface + Error503 func(ErrUnexpectedResponseCode) error + type ErrAPIKeyProvided struct + func (e ErrAPIKeyProvided) Error() string + type ErrAppCredMissingSecret struct + func (e ErrAppCredMissingSecret) Error() string + type ErrDefault400 struct + func (e ErrDefault400) Error() string + type ErrDefault401 struct + func (e ErrDefault401) Error() string + type ErrDefault403 struct + func (e ErrDefault403) Error() string + type ErrDefault404 struct + func (e ErrDefault404) Error() string + type ErrDefault405 struct + func (e ErrDefault405) Error() string + type ErrDefault408 struct + func (e ErrDefault408) Error() string + type ErrDefault409 struct + type ErrDefault429 struct + func (e ErrDefault429) Error() string + type ErrDefault500 struct + func (e ErrDefault500) Error() string + type ErrDefault503 struct + func (e ErrDefault503) Error() string + type ErrDomainIDOrDomainName struct + func (e ErrDomainIDOrDomainName) Error() string + type ErrDomainIDWithToken struct + func (e ErrDomainIDWithToken) Error() string + type ErrDomainIDWithUserID struct + func (e ErrDomainIDWithUserID) Error() string + type ErrDomainNameWithToken struct + func (e ErrDomainNameWithToken) Error() string + type ErrDomainNameWithUserID struct + func (e ErrDomainNameWithUserID) Error() string + type ErrEndpointNotFound struct + func (e ErrEndpointNotFound) Error() string + type ErrErrorAfterReauthentication struct + ErrOriginal error + func (e ErrErrorAfterReauthentication) Error() string + type ErrInvalidInput struct + Value interface{} + func (e ErrInvalidInput) Error() string + type ErrMissingAnyoneOfEnvironmentVariables struct + EnvironmentVariables []string + func (e ErrMissingAnyoneOfEnvironmentVariables) Error() string + type ErrMissingEnvironmentVariable struct + EnvironmentVariable string + func (e ErrMissingEnvironmentVariable) Error() string + type ErrMissingInput struct + Argument string + func (e ErrMissingInput) Error() string + type ErrMissingPassword struct + func (e ErrMissingPassword) Error() string + type ErrMultipleResourcesFound struct + Count int + Name string + ResourceType string + func (e ErrMultipleResourcesFound) Error() string + type ErrResourceNotFound struct + Name string + ResourceType string + func (e ErrResourceNotFound) Error() string + type ErrResult struct + func (r ErrResult) ExtractErr() error + type ErrScopeDomainIDOrDomainName struct + func (e ErrScopeDomainIDOrDomainName) Error() string + type ErrScopeEmpty struct + func (e ErrScopeEmpty) Error() string + type ErrScopeProjectIDAlone struct + func (e ErrScopeProjectIDAlone) Error() string + type ErrScopeProjectIDOrProjectName struct + func (e ErrScopeProjectIDOrProjectName) Error() string + type ErrServiceNotFound struct + func (e ErrServiceNotFound) Error() string + type ErrTenantIDProvided struct + func (e ErrTenantIDProvided) Error() string + type ErrTenantNameProvided struct + func (e ErrTenantNameProvided) Error() string + type ErrTimeOut struct + func (e ErrTimeOut) Error() string + type ErrUnableToReauthenticate struct + ErrOriginal error + func (e ErrUnableToReauthenticate) Error() string + type ErrUnexpectedResponseCode struct + Actual int + Body []byte + Expected []int + Method string + URL string + func (e ErrUnexpectedResponseCode) Error() string + type ErrUnexpectedType struct + Actual string + Expected string + func (e ErrUnexpectedType) Error() string + type ErrUserIDWithToken struct + func (e ErrUserIDWithToken) Error() string + type ErrUsernameOrUserID struct + func (e ErrUsernameOrUserID) Error() string + type ErrUsernameWithToken struct + func (e ErrUsernameWithToken) Error() string + type HeaderResult struct + func (r HeaderResult) ExtractInto(to interface{}) error + type IPVersion int + const IPv4 + const IPv6 + type JSONRFC1123 time.Time + func (jt *JSONRFC1123) UnmarshalJSON(data []byte) error + type JSONRFC3339Milli time.Time + func (jt *JSONRFC3339Milli) UnmarshalJSON(data []byte) error + type JSONRFC3339MilliNoZ time.Time + func (jt *JSONRFC3339MilliNoZ) UnmarshalJSON(data []byte) error + type JSONRFC3339NoZ time.Time + func (jt *JSONRFC3339NoZ) UnmarshalJSON(data []byte) error + type JSONRFC3339ZNoT time.Time + func (jt *JSONRFC3339ZNoT) UnmarshalJSON(data []byte) error + type JSONRFC3339ZNoTNoZ time.Time + func (jt *JSONRFC3339ZNoTNoZ) UnmarshalJSON(data []byte) error + type JSONUnix time.Time + func (jt *JSONUnix) UnmarshalJSON(data []byte) error + type Link struct + Href string + Rel string + type ProviderClient struct + Context context.Context + EndpointLocator EndpointLocator + HTTPClient http.Client + IdentityBase string + IdentityEndpoint string + ReauthFunc func() error + Throwaway bool + TokenID string + UserAgent UserAgent + func (client *ProviderClient) AuthenticatedHeaders() (m map[string]string) + func (client *ProviderClient) CopyTokenFrom(other *ProviderClient) + func (client *ProviderClient) GetAuthResult() AuthResult + func (client *ProviderClient) IsThrowaway() bool + func (client *ProviderClient) Reauthenticate(previousToken string) error + func (client *ProviderClient) Request(method, url string, options *RequestOpts) (*http.Response, error) + func (client *ProviderClient) SetThrowaway(v bool) + func (client *ProviderClient) SetToken(t string) + func (client *ProviderClient) SetTokenAndAuthResult(r AuthResult) error + func (client *ProviderClient) Token() string + func (client *ProviderClient) UseTokenLock() + type RequestOpts struct + ErrorContext error + JSONBody interface{} + JSONResponse interface{} + MoreHeaders map[string]string + OkCodes []int + RawBody io.Reader + type Result struct + Body interface{} + Err error + Header http.Header + func (r Result) ExtractInto(to interface{}) error + func (r Result) ExtractIntoSlicePtr(to interface{}, label string) error + func (r Result) ExtractIntoStructPtr(to interface{}, label string) error + func (r Result) PrettyPrintJSON() string + type ServiceClient struct + Endpoint string + Microversion string + MoreHeaders map[string]string + ResourceBase string + Type string + func (client *ServiceClient) Delete(url string, opts *RequestOpts) (*http.Response, error) + func (client *ServiceClient) Get(url string, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) + func (client *ServiceClient) Head(url string, opts *RequestOpts) (*http.Response, error) + func (client *ServiceClient) Patch(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) + func (client *ServiceClient) Post(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) + func (client *ServiceClient) Put(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) + func (client *ServiceClient) Request(method, url string, options *RequestOpts) (*http.Response, error) + func (client *ServiceClient) ResourceBaseURL() string + func (client *ServiceClient) ServiceURL(parts ...string) string + type UserAgent struct + func (ua *UserAgent) Join() string + func (ua *UserAgent) Prepend(s ...string)