import "github.com/OShalakhin/cloud/storage"
Package storage provides abstract layer for cloud storages that should provide basically CRUD and Authentication methods.
const (
// CloudFiles name for Rackspace CloudFiles storage
CloudFiles = "CloudFiles"
// S3 name for Amazon S3
S3 = "S3"
// Local storage
Local = "Local"
)
type Cloud struct {
Containers []Container `json:"containers"`
}Cloud is config for .cloud
type Container struct {
Provider string `json:"provider"`
Name string `json:"name"`
}Container data to work with later
type Core struct {
Providers []Provider `json:"providers"`
}Core is ~/.cloudcore struct
type Provider struct {
Provider string `json:"provider"`
Name string `json:"name"`
Key string `json:"key"`
Secret string `json:"secret,omitempty"`
AuthURL string `json:"auth_url,omitempty"`
}Provider for the cloud like Amazon, Rackspace etc.
type Storage interface {
Create(filename string, data []byte) error
Read(filename string) ([]byte, error)
Update(filename string, data []byte) error
// Upsert(filename string, data []byte) error
Delete(filename string) error
Authenticate() error
GetContainer() (*Container, error)
GetURL() *url.URL
}Storage interface for abstraction
| Path | Synopsis |
|---|---|
| cloudfiles | Package cloudfiles provides implementation of Storage for Rackspace CloudFiles |
| local | Package local implements local storage |
Package storage imports 1 packages (graph) and is imported by 3 packages. Updated 2014-03-17. Refresh now. Tools for package owners.