cloud: github.com/OShalakhin/cloud/storage Index | Files | Directories

package storage

import "github.com/OShalakhin/cloud/storage"

Package storage provides abstract layer for cloud storages that should provide basically CRUD and Authentication methods.

Index

Package Files

storage.go

Constants

const (
    // CloudFiles name for Rackspace CloudFiles storage
    CloudFiles = "CloudFiles"
    // S3 name for Amazon S3
    S3  = "S3"
    // Local storage
    Local = "Local"
)

type Cloud

type Cloud struct {
    Containers []Container `json:"containers"`
}

Cloud is config for .cloud

type Container

type Container struct {
    Provider string `json:"provider"`
    Name     string `json:"name"`
}

Container data to work with later

type Core

type Core struct {
    Providers []Provider `json:"providers"`
}

Core is ~/.cloudcore struct

type Provider

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

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

Directories

PathSynopsis
cloudfilesPackage cloudfiles provides implementation of Storage for Rackspace CloudFiles
localPackage 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.