An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/gophercloud/gophercloud

Package gophercloud provides a multi-vendor interface to OpenStack-compatible clouds. The library has a three-level hierarchy: providers, services, and resources. Provider structs represent the cloud providers that offer and manage a collection of services. You will generally want to create one Provider client per OpenStack cloud. Use your OpenStack credentials to create a Provider client. The IdentityEndpoint is typically refered to as "auth_url" or "OS_AUTH_URL" in information provided by the cloud operator. Additionally, the cloud may refer to TenantID or TenantName as project_id and project_name. Credentials are specified like so: You can authenticate with a token by doing: You may also use the openstack.AuthOptionsFromEnv() helper function. This function reads in standard environment variables frequently found in an OpenStack `openrc` file. Again note that Gophercloud currently uses "tenant" instead of "project". Service structs are specific to a provider and handle all of the logic and operations for a particular OpenStack service. Examples of services include: Compute, Object Storage, Block Storage. In order to define one, you need to pass in the parent provider, like so: Resource structs are the domain models that services make use of in order to work with and represent the state of API resources: Intermediate Result structs are returned for API operations, which allow generic access to the HTTP headers, response body, and any errors associated with the network transaction. To turn a result into a usable resource struct, you must call the Extract method which is chained to the response, or an Extract function from an applicable extension: All requests that enumerate a collection return a Pager struct that is used to iterate through the results one page at a time. Use the EachPage method on that Pager to handle each successive Page in a closure, then use the appropriate extraction method from that request's package to interpret that Page as a slice of results: If you want to obtain the entire collection of pages without doing any intermediary processing on each page, you can use the AllPages method: This top-level package contains utility functions and data types that are used throughout the provider and service packages. Of particular note for end users are the AuthOptions and EndpointOpts structs. An example retry backoff function, which respects the 429 HTTP response code and a "Retry-After" header:

Ecosystem
proxy.golang.org
Latest Release
v1.14.1
over 1 year ago
Versions
42
Dependent Packages
6,823
Dependent Repos
22,292
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/gophercloud/gophercloud
spec
License Apache-2.0
Namespace github.com/gophercloud
First Release almost 7 years ago
Last Synced about 22 hours ago
Keywords
go openstack sdk
Repository
Stars 966 on GitHub
Forks 571 on GitHub
Docker Dependents 2,265
Docker Downloads 12,010,790,883
Commits 3985
Committers 345
Avg per Author 11.551
DDS 0.827
Rankings on proxy.golang.org
Overall Top 0.7%
Dependent packages Top 0.1%
Dependent repos Top 0.1%
Forks Top 1.3%
Docker downloads Top 0.1%