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

Top 7.3% on proxy.golang.org
Top 2.2% dependent packages on proxy.golang.org
Top 1.8% dependent repos on proxy.golang.org

proxy.golang.org : github.com/majewsky/schwift

Package schwift is a client library for OpenStack Swift (https://github.com/openstack/swift, https://openstack.org). Schwift does not implement authentication (neither Keystone nor Swift v1), but can be plugged into any library that does. The most common choice is Gophercloud (https://github.com/gophercloud/gophercloud). When using Gophercloud, you usually start by obtaining a gophercloud.ServiceClient for Swift like so: Then, in all these cases, you use gopherschwift to convert the gophercloud.ServiceClient into a schwift.Account instance, from which point you have access to all of schwift's API: For example, to download an object's contents into a string: If you use a different Go library to handle Keystone/Swift authentication, take the client object that it provides and wrap it into something that implements the schwift.Backend interface. Then use schwift.InitializeAccount() to obtain a schwift.Account. When a GET or HEAD request is sent by an Account, Container or Object instance, the headers associated with that thing will be stored in that instance and not retrieved again. If this behavior is not desired, the Invalidate() method can be used to clear caches on any Account, Container or Object instance. Some methods that modify the instance on the server call Invalidate() automatically, e.g. Object.Upload(), Update() or Delete(). This will be indicated in the method's documentation. When a method on an Account, Container or Object instance makes a HTTP request to Swift and Swift returns an unexpected status code, a schwift.UnexpectedStatusCodeError will be returned. Schwift provides the convenience function Is() to check the status code of these errors to detect common failure situations: The documentation for a method may indicate certain common error conditions that can be detected this way by stating that "This method fails with http.StatusXXX if ...". Because of the wide variety of failure modes in Swift, this information is not guaranteed to be exhaustive.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/majewsky/schwift
License: Apache-2.0
Latest release: over 1 year ago
First release: almost 4 years ago
Namespace: github.com/majewsky
Dependent packages: 6
Dependent repositories: 8
Stars: 6 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 1 month ago

    Loading...
    Readme
    Loading...