Go client for the Conoha Object Storage Service (OpenStack Swift) API
execute:
$ go get github.com/pdevty/conohaswift
package main
import (
"github.com/pdevty/conohaswift"
)
func main() {
// new client
client, err := conohaswift.NewClient("./conohaswift.tml")
if err != nil {
panic(err)
}
// account quota 100GB
_, err := client.SetAccountQuota("100")
if err != nil {
panic(err)
}
// create container
_, err := client.CreateContainer("container1")
if err != nil {
panic(err)
}
// object upload
_, err := client.ObjectUpload("container1","object1")
if err != nil {
panic(err)
}
}conohaswift.toml
user_name = "12345"
password = "*****"
tenant_id = "12345"
region = "tyo1"Refer to godoc for more infomation.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request