Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/swiftPublic

Go language interface to Swift / Openstack Object Storage / Rackspace cloud files (golang)

License

NotificationsYou must be signed in to change notification settings

ncw/swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Build StatusGo Reference

Install

Use go to install the library

go get github.com/ncw/swift/v2

Usage

See here for full package docs

Here is a short example from the docs

import"github.com/ncw/swift/v2"// Create a connectionc:= 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)}// Authenticateerr:=c.Authenticate()iferr!=nil {panic(err)}// List all the containerscontainers,err:=c.ContainerNames(nil)fmt.Println(containers)// etc...

Migrating fromv1

The library has current major version v2. If you want to migrate from the first version oflibrarygithub.com/ncw/swift you have to explicitly add the/v2 suffix to the imports.

Most of the exported functions were added a newcontext.Context parameter in thev2, which you will have to providewhen migrating.

Additions

Thers 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 aRackspace 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 withgo 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

About

Go language interface to Swift / Openstack Object Storage / Rackspace cloud files (golang)

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors44

Languages


[8]ページ先頭

©2009-2025 Movatter.jp