Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenOptionsFromEnv ¶
func TokenOptionsFromEnv() (token.TokenOptions, error)
AuthOptionsFromEnv fills out an identity.AuthOptions structure with the settings found on the various OpenStack OS_* environment variables.
The following variables provide sources of truth: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_TENANT_ID, and OS_TENANT_NAME.
Of these, OS_USERNAME, OS_PASSWORD, and OS_AUTH_URL must have settings, or an error will result. OS_TENANT_ID, OS_TENANT_NAME, OS_PROJECT_ID, and OS_PROJECT_NAME are optional.
OS_TENANT_ID and OS_TENANT_NAME are mutually exclusive to OS_PROJECT_ID and OS_PROJECT_NAME. If OS_PROJECT_ID and OS_PROJECT_NAME are set, they will still be referred as "tenant" in Gophercloud.
To use this function, first set the OS_* environment variables (for example, by sourcing an `openrc` file), then:
opts, err := openstack.AuthOptionsFromEnv() provider, err := openstack.AuthenticatedClient(opts)
Types ¶
type AuthOptionsProvider ¶
type AuthOptionsProvider interface { GetIdentityEndpoint() string GetProjectId() string GetDomainId() string }
AuthOptionsProvider presents the base of an auth options implementation
Directories ¶
Path | Synopsis |
---|---|
Package signer providers functions for sign http request before request cloud Sample code: client := &http.Client{ Timeout: time.Duration(3 * time.Second), } req, err := http.NewRequest("POST", "https://30030113-3657-4fb6-a7ef-90764239b038.apigw.xxx.yyy.com/app1?name=value", bytes.NewBuffer([]byte("demo"))) signOptions := signer.SignOptions{ AccessKey: "------------", SecretKey: "------------", } signer.Sign(req, signOptions) resp, err := client.Do(req)
|
Package signer providers functions for sign http request before request cloud Sample code: client := &http.Client{ Timeout: time.Duration(3 * time.Second), } req, err := http.NewRequest("POST", "https://30030113-3657-4fb6-a7ef-90764239b038.apigw.xxx.yyy.com/app1?name=value", bytes.NewBuffer([]byte("demo"))) signOptions := signer.SignOptions{ AccessKey: "------------", SecretKey: "------------", } signer.Sign(req, signOptions) resp, err := client.Do(req) |