client

package
v0.0.0-...-bd97054 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Object     = iota // Minio and S3 compatible cloud storage
	Filesystem        // POSIX compatible file systems
)

enum types

Variables

This section is empty.

Functions

This section is empty.

Types

type APINotImplemented

type APINotImplemented struct {
	API     string
	APIType string
}

APINotImplemented - api not implemented

func (APINotImplemented) Error

func (e APINotImplemented) Error() string
type BrokenSymlink GenericFileError

BrokenSymlink (ENOTENT) - file has broken symlink.

func (BrokenSymlink) Error

func (e BrokenSymlink) Error() string

type BucketExists

type BucketExists GenericBucketError

BucketExists - bucket exists

func (BucketExists) Error

func (e BucketExists) Error() string

type BucketNameEmpty

type BucketNameEmpty struct{}

BucketNameEmpty - bucket name empty (http://goo.gl/wJlzDz)

func (BucketNameEmpty) Error

func (e BucketNameEmpty) Error() string

type BucketNameTopLevel

type BucketNameTopLevel struct{}

BucketNameTopLevel - generic error

func (BucketNameTopLevel) Error

func (e BucketNameTopLevel) Error() string

type Client

type Client interface {
	// Common operations
	Stat() (content *Content, err *probe.Error)
	List(recursive, incomplete bool) <-chan *Content

	// Bucket operations
	MakeBucket() *probe.Error
	GetBucketAccess() (access string, error *probe.Error)
	SetBucketAccess(access string) *probe.Error

	// I/O operations
	Get(offset, length int64) (body io.ReadSeeker, err *probe.Error)
	Put(data io.ReadSeeker, size int64, contentType string) *probe.Error

	// I/O operations with expiration
	ShareDownload(expires time.Duration) (string, *probe.Error)
	ShareUpload(bool, time.Duration, string) (map[string]string, *probe.Error)

	// Delete operations
	Remove(incomplete bool) *probe.Error

	// GetURL returns back internal url
	GetURL() URL
}

Client - client interface

type Config

type Config struct {
	AccessKey   string
	SecretKey   string
	Signature   string
	HostURL     string
	AppName     string
	AppVersion  string
	AppComments []string
	Debug       bool
}

Config - see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html

type Content

type Content struct {
	URL  URL
	Time time.Time
	Size int64
	Type os.FileMode
	Err  *probe.Error
}

Content container for content metadata

type EmptyPath

type EmptyPath struct{}

EmptyPath (EINVAL) - invalid argument.

func (EmptyPath) Error

func (e EmptyPath) Error() string

type GenericBucketError

type GenericBucketError struct {
	Bucket string
}

GenericBucketError - generic bucket operations error

type GenericFileError

type GenericFileError struct {
	Path string
}

GenericFileError - generic file error.

type GenericObjectError

type GenericObjectError struct {
	Bucket string
	Object string
}

GenericObjectError - generic object operations error

type InvalidBucketName

type InvalidBucketName GenericBucketError

InvalidBucketName - bucket name invalid (http://goo.gl/wJlzDz)

func (InvalidBucketName) Error

func (e InvalidBucketName) Error() string

type InvalidObjectName

type InvalidObjectName GenericObjectError

InvalidObjectName - object requested is invalid

func (InvalidObjectName) Error

func (e InvalidObjectName) Error() string

type InvalidRange

type InvalidRange struct {
	Offset int64
}

InvalidRange - invalid range requested

func (InvalidRange) Error

func (e InvalidRange) Error() string

type ObjectAlreadyExists

type ObjectAlreadyExists struct {
	Object string
}

ObjectAlreadyExists - typed return for MethodNotAllowed

func (ObjectAlreadyExists) Error

func (e ObjectAlreadyExists) Error() string

type ObjectMissing

type ObjectMissing struct{}

ObjectMissing (EINVAL) - object key missing.

func (ObjectMissing) Error

func (e ObjectMissing) Error() string

type PathInsufficientPermission

type PathInsufficientPermission GenericFileError

PathInsufficientPermission (EPERM) - permission denied.

func (PathInsufficientPermission) Error

type PathIsDir

type PathIsDir GenericFileError

PathIsDir (EISDIR) - file is a folder.

func (PathIsDir) Error

func (e PathIsDir) Error() string

type PathNotFound

type PathNotFound GenericFileError

PathNotFound (ENOENT) - file not found.

func (PathNotFound) Error

func (e PathNotFound) Error() string
type TooManyLevelsSymlink GenericFileError

TooManyLevelsSymlink (ELOOP) - file has too many levels of symlinks.

func (TooManyLevelsSymlink) Error

func (e TooManyLevelsSymlink) Error() string

type URL

type URL struct {
	Type            URLType
	Scheme          string
	Host            string
	Path            string
	SchemeSeparator string
	Separator       rune
}

URL client url structure

func JoinURLs

func JoinURLs(url1, url2 *URL) *URL

JoinURLs join two input urls and returns a url

func NewURL

func NewURL(urlStr string) *URL

NewURL returns an abstracted URL for filesystems and object storage.

func (URL) String

func (u URL) String() string

String convert URL into its canonical form.

type URLType

type URLType int

URLType - enum of different url types

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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