ostore

package
v0.0.0-...-da8896c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2015 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STORE_TYPE_SWIFT = iota
	STORE_TYPE_S3    = iota
)
View Source
const (
	S3_ACCES_KEY    = "access_key"
	S3_SECRET_KEY   = "secret_key"
	S3_ENDPOINT_URL = "endpoint"
	S3_BUCKET       = "bucket_name"
)
View Source
const (
	SWIFT_AUTH_URL    = "auth_url"
	SWIFT_USER_NAME   = "user"
	SWIFT_API_KEY     = "api_key"
	SWIFT_TENANT      = "tenant"
	SWIFT_TENANT_ID   = "tenant_id"
	SWIFT_STORAGE_URL = "storage_url"
	SWIFT_AUTH_TOKEN  = "auth_token"
	SWIFT_CONTAINER   = "container"
)
View Source
const (
	FS_ROOT_PATH = "root_path"
)

Variables

View Source
var (
	ErrHashMismatch  = errors.New("Stored Object's expected hash did not match real hash")
	ErrNotExists     = errors.New("Object does not exist")
	ErrAlreadyExists = errors.New("Object already exists")
)

Functions

This section is empty.

Types

type FSStore

type FSStore struct {
	// contains filtered or unexported fields
}

func (*FSStore) Delete

func (fs *FSStore) Delete(so *StoredObject) error

func (*FSStore) Get

func (fs *FSStore) Get(so *StoredObject, data io.Writer) error

func (*FSStore) Initialize

func (fs *FSStore) Initialize(c map[string]string) error

func (*FSStore) Put

func (fs *FSStore) Put(so *StoredObject, data io.Reader, length int64) error

type HashReader

type HashReader struct {
	// contains filtered or unexported fields
}

func NewHashReader

func NewHashReader(r io.Reader) *HashReader

func (*HashReader) Digest

func (hr *HashReader) Digest() []byte

func (*HashReader) HexDigest

func (hr *HashReader) HexDigest() string

func (*HashReader) Read

func (hr *HashReader) Read(p []byte) (int, error)

type ObjectStore

type ObjectStore struct {
	db.Record

	Organization string
	Name         string
	Type         int
	// contains filtered or unexported fields
}

func NewObjectStore

func NewObjectStore(o *registry.Organization) *ObjectStore

func (*ObjectStore) Create

func (so *ObjectStore) Create() error

func (*ObjectStore) NewObject

func (os *ObjectStore) NewObject() *StoredObject

func (*ObjectStore) Store

func (so *ObjectStore) Store() error

func (*ObjectStore) Validate

func (so *ObjectStore) Validate() error

type S3Store

type S3Store struct {
	// contains filtered or unexported fields
}

func (*S3Store) Delete

func (s *S3Store) Delete(so *StoredObject) error

func (*S3Store) Get

func (s *S3Store) Get(so *StoredObject, data io.Writer) error

func (*S3Store) Initialize

func (s *S3Store) Initialize(c map[string]string) error

func (*S3Store) Put

func (s *S3Store) Put(so *StoredObject, data io.Reader, length int64) error

type Store

type Store interface {
	Put(*StoredObject, io.Reader, int64) error
	Get(*StoredObject, io.Writer) error
	Delete(*StoredObject) error
}

type StoredObject

type StoredObject struct {
	db.Record

	User         string
	Group        string
	Organization string
	StoreName    string
	Expiration   time.Time
	Type         string
	Hash         string
	Metadata     map[string]string
	// contains filtered or unexported fields
}

func (*StoredObject) Create

func (so *StoredObject) Create() error

func (*StoredObject) Store

func (so *StoredObject) Store() error

func (*StoredObject) Validate

func (so *StoredObject) Validate() error

type SwiftStore

type SwiftStore struct {
	// contains filtered or unexported fields
}

func (*SwiftStore) Delete

func (s *SwiftStore) Delete(so *StoredObject) error

func (*SwiftStore) Get

func (s *SwiftStore) Get(so *StoredObject, data io.Writer) error

func (*SwiftStore) Initialize

func (s *SwiftStore) Initialize(c map[string]string) error

func (*SwiftStore) Put

func (s *SwiftStore) Put(so *StoredObject, data io.Reader, length int64) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL