registry/vendor/github.com/ncw/swift
Sebastiaan van Stijn 6e8dd268a8
update to go 1.18 (continue testing against 1.17)
Go 1.16 reached end of life, so update to the current version of Go, but also
run CI on the previous version (which is still supported).

We should probably also decide wether or not we want the Dockerfiles to pin to
a specific minor version; this makes the releases more deterministic.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-05 10:36:28 +02:00
..
swifttest update github.com/ncw/swift package in vendor to avoid potential memory leaks 2018-09-05 00:28:40 -07:00
.gitignore migrate to go modules from vndr 2019-06-19 12:24:07 -07:00
.travis.yml update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
auth.go update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
auth_v3.go update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
compatibility_1_0.go Move to vendor 2016-03-22 10:45:49 -07:00
compatibility_1_1.go Move to vendor 2016-03-22 10:45:49 -07:00
compatibility_1_6.go update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
compatibility_not_1_6.go update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
COPYING Move to vendor 2016-03-22 10:45:49 -07:00
dlo.go update github.com/ncw/swift package in vendor to avoid potential memory leaks 2018-09-05 00:28:40 -07:00
doc.go Move to vendor 2016-03-22 10:45:49 -07:00
largeobjects.go update github.com/ncw/swift package in vendor to avoid potential memory leaks 2018-09-05 00:28:40 -07:00
meta.go update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
notes.txt migrate to go modules from vndr 2019-06-19 12:24:07 -07:00
README.md update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
slo.go update github.com/ncw/swift package in vendor to v1.0.40 2018-09-05 00:28:40 -07:00
swift.go update the golang compiler version and the versions of several dependencies 2019-06-19 22:43:52 -07:00
timeout_reader.go update github.com/ncw/swift package in vendor to avoid potential memory leaks 2018-09-05 00:28:40 -07:00
travis_realserver.sh migrate to go modules from vndr 2019-06-19 12:24:07 -07:00
watchdog_reader.go update github.com/ncw/swift package in vendor to avoid potential memory leaks 2018-09-05 00:28:40 -07:00

Swift

This package provides an easy to use library for interfacing with Swift / Openstack Object Storage / Rackspace cloud files from the Go Language

See here for package docs

http://godoc.org/github.com/ncw/swift

Build Status GoDoc

Install

Use go to install the library

go get github.com/ncw/swift

Usage

See here for full package docs

Here is a short example from the docs

import "github.com/ncw/swift"

// Create a connection
c := swift.Connection{
    UserName: "user",
    ApiKey:   "key",
    AuthUrl:  "auth_url",
    Domain:   "domain",  // Name of the domain (v3 auth only)
    Tenant:   "tenant",  // Name of the tenant (v2 auth only)
}
// Authenticate
err := c.Authenticate()
if err != nil {
    panic(err)
}
// List all the containers
containers, err := c.ContainerNames(nil)
fmt.Println(containers)
// etc...

Additions

The rs sub project contains a wrapper for the Rackspace specific CDN Management interface.

Testing

To run the tests you can either use an embedded fake Swift server either use a real Openstack Swift server or a Rackspace Cloud files account.

When using a real Swift server, you need to set these environment variables before running the tests

export SWIFT_API_USER='user'
export SWIFT_API_KEY='key'
export SWIFT_AUTH_URL='https://url.of.auth.server/v1.0'

And optionally these if using v2 authentication

export SWIFT_TENANT='TenantName'
export SWIFT_TENANT_ID='TenantId'

And optionally these if using v3 authentication

export SWIFT_TENANT='TenantName'
export SWIFT_TENANT_ID='TenantId'
export SWIFT_API_DOMAIN_ID='domain id'
export SWIFT_API_DOMAIN='domain name'

And optionally these if using v3 trust

export SWIFT_TRUST_ID='TrustId'

And optionally this if you want to skip server certificate validation

export SWIFT_AUTH_INSECURE=1

And optionally this to configure the connect channel timeout, in seconds

export SWIFT_CONNECTION_CHANNEL_TIMEOUT=60

And optionally this to configure the data channel timeout, in seconds

export SWIFT_DATA_CHANNEL_TIMEOUT=60

Then run the tests with go test

License

This is free software under the terms of MIT license (check COPYING file included in this package).

Contact and support

The project website is at:

There you can file bug reports, ask for help or contribute patches.

Authors

Contributors