![Selectel](https://camo.githubusercontent.com/6da20ec18a505679cc53b9df236c507e3b4f5ab19eb870efabaa110ee3be12d5/687474703a2f2f626c6f672e73656c656374656c2e72752f77702d636f6e74656e742f7468656d65732f73656c656374656c2f7374617469632f696d672f73656c656374656c2e706e67)
Language Files Code Comment Blank Total
Go 12 2554 155 157 2866
Markdown 1 82 0 25 98
Assertions: ~747
Integrational tests included
![Go Walker](https://camo.githubusercontent.com/ef2c6d71c1d3bef4fa1e7c5a872505fd004423be5c90383ef414fa77efa3dc8e/687474703a2f2f676f77616c6b65722e6f72672f6170692f76312f6261646765)
go get github.com/ernado/selectel/storage
package main
import (
"fmt"
"github.com/ernado/selectel/storage"
"log"
)
const (
user = "123456"
key = "password"
)
func main() {
api, err := storage.New(user, key)
if err != nil {
log.Fatal(err)
}
info := api.Info()
fmt.Printf("Used %d bytes\n", info.BytesUsed)
containers, _ := api.Containers()
fmt.Printf("You have %d containers\n", len(containers))
for _, container := range containers {
objects, _ := container.Objects()
fmt.Printf("Container %s has %d objects\n", container.Name(), len(objects))
}
}
Selectel Storage console client
![Gobuild Download](https://camo.githubusercontent.com/2bdc7f115506978dfd844d538a836d1777592d2b12ea1746d96c5d8589e5545f/687474703a2f2f676f6275696c642e696f2f62616467652f6769746875622e636f6d2f65726e61646f2f73656c656374656c2f73746f726167652f73656c63746c2f646f776e6c6f6164732e737667)
go get github.com/ernado/selectel/storage/selctl
$ selctl -h
Usage:
selctl [options...] <command> [arg...]
Selectel storage command line client
Options:
--cache # cache credentials in file (SELECTEL_CACHE)
--cache.secure # encrypt/decrypt token with user-key pair
-c, --container="" # default container (SELECTEL_CONTAINER)
--debug # debug mode
-h, --help # show help and exit
-k, --key="" # selectel storage key (SELECTEL_KEY)
-u, --user="" # selectel storage user (SELECTEL_USER)
-v, --version # show version and exit
Commands:
upload upload object to container
download download object from container
create create container
remove remove object or container
info print information about storage/container/object
list list objects in container/storage
$ selctl info cydev main.go
# {Size:304 ContentType:application/octet-stream Downloaded:0
# Hash:f9126007fe5ac982caa9b86ad06158a9
# LastModifiedStr: LastModified:2014-09-21 00:39:25 +0000 GMT
# Name:main.go}