Documentation ¶
Index ¶
- Constants
- func CleanupWritersOnError(writers []io.WriteCloser)
- func Delimiter(object, delimiter string) string
- func HasDelimiter(objects []string, delim string) []string
- func HasNoDelimiter(objects []string, delim string) []string
- func IsValidBucket(bucket string) bool
- func IsValidBucketACL(acl string) bool
- func IsValidDonut(donutName string) bool
- func IsValidObjectName(object string) bool
- func IsValidPrefix(prefix string) bool
- func RemoveDuplicates(slice []string) []string
- func SaveConfig(a *Config) *probe.Error
- func SetDonutConfigPath(configPath string)
- func SortUnique(objects []string) []string
- func SplitDelimiter(objects []string, delim string) []string
- func TrimPrefix(objects []string, prefix string) []string
- type API
- func (donut API) AbortMultipartUpload(bucket, key, uploadID string, signature *Signature) *probe.Error
- func (donut API) AttachNode(hostname string, disks []string) *probe.Error
- func (donut API) CompleteMultipartUpload(bucket, key, uploadID string, data io.Reader, signature *Signature) (ObjectMetadata, *probe.Error)
- func (donut API) CreateObject(bucket, key, expectedMD5Sum string, size int64, data io.Reader, ...) (ObjectMetadata, *probe.Error)
- func (donut API) CreateObjectPart(bucket, key, uploadID string, partID int, contentType, expectedMD5Sum string, ...) (string, *probe.Error)
- func (donut API) DetachNode(hostname string) *probe.Error
- func (donut API) GetBucketMetadata(bucket string, signature *Signature) (BucketMetadata, *probe.Error)
- func (donut API) GetObject(w io.Writer, bucket string, object string, start, length int64) (int64, *probe.Error)
- func (donut API) GetObjectMetadata(bucket, key string, signature *Signature) (ObjectMetadata, *probe.Error)
- func (donut API) Heal() *probe.Error
- func (donut API) Info() (nodeDiskMap map[string][]string, err *probe.Error)
- func (donut API) ListBuckets(signature *Signature) ([]BucketMetadata, *probe.Error)
- func (donut API) ListMultipartUploads(bucket string, resources BucketMultipartResourcesMetadata, ...) (BucketMultipartResourcesMetadata, *probe.Error)
- func (donut API) ListObjectParts(bucket, key string, resources ObjectResourcesMetadata, signature *Signature) (ObjectResourcesMetadata, *probe.Error)
- func (donut API) ListObjects(bucket string, resources BucketResourcesMetadata, signature *Signature) ([]ObjectMetadata, BucketResourcesMetadata, *probe.Error)
- func (donut API) MakeBucket(bucketName, acl string, location io.Reader, signature *Signature) *probe.Error
- func (donut API) NewMultipartUpload(bucket, key, contentType string, signature *Signature) (string, *probe.Error)
- func (donut API) Rebalance() *probe.Error
- func (donut API) SetBucketMetadata(bucket string, metadata map[string]string, signature *Signature) *probe.Error
- type APINotImplemented
- type AllBuckets
- type BackendCorrupted
- type BackendError
- type BadDigest
- type BucketACL
- type BucketExists
- type BucketMetadata
- type BucketMultipartResourcesMetadata
- type BucketNameInvalid
- type BucketNotFound
- type BucketResourcesMetadata
- type ChecksumMismatch
- type CloudStorage
- type CompleteMultipartUpload
- type CompletePart
- type Config
- type CorruptedBackend
- type DigestError
- type EntityTooLarge
- type GenericBucketError
- type GenericObjectError
- type ImplementationError
- type IncompleteBody
- type Interface
- type InternalError
- type InvalidACL
- type InvalidArgument
- type InvalidDigest
- type InvalidDisksArgument
- type InvalidErasureTechnique
- type InvalidPart
- type InvalidPartOrder
- type InvalidRange
- type InvalidUploadID
- type ListObjectsResults
- type MalformedXML
- type Management
- type Metadata
- type MissingDateHeader
- type MissingErasureTechnique
- type MultiPartSession
- type Multipart
- type NotImplemented
- type ObjectCorrupted
- type ObjectExists
- type ObjectMetadata
- type ObjectNameInvalid
- type ObjectNotFound
- type ObjectResourcesMetadata
- type OperationNotPermitted
- type ParityOverflow
- type PartMetadata
- type ProxyWriter
- type Signature
- type SignatureDoesNotMatch
- type TooManyBuckets
- type UnsupportedFilesystem
- type UploadMetadata
Constants ¶
const ( BucketPrivate = BucketACL("private") BucketPublicRead = BucketACL("public-read") BucketPublicReadWrite = BucketACL("public-read-write") )
different types of ACL's currently supported for buckets
Variables ¶
This section is empty.
Functions ¶
func CleanupWritersOnError ¶
func CleanupWritersOnError(writers []io.WriteCloser)
CleanupWritersOnError purge writers on error
func HasDelimiter ¶
HasDelimiter provides a new slice from an input slice which has elements with a delimiter
func HasNoDelimiter ¶
HasNoDelimiter provides a new slice from an input slice which has elements without delimiter
func IsValidBucket ¶
IsValidBucket - verify bucket name in accordance with
func IsValidBucketACL ¶
IsValidBucketACL - is provided acl string supported
func IsValidDonut ¶
IsValidDonut - verify donut name is correct
func IsValidObjectName ¶
IsValidObjectName - verify object name in accordance with
func IsValidPrefix ¶
IsValidPrefix - verify prefix name is correct, an empty prefix is valid
func RemoveDuplicates ¶
RemoveDuplicates removes duplicate elements from a slice
func SetDonutConfigPath ¶
func SetDonutConfigPath(configPath string)
SetDonutConfigPath - set custom donut config path
func SortUnique ¶
SortUnique sort a slice in lexical order, removing duplicate elements
func SplitDelimiter ¶
SplitDelimiter provides a new slice from an input slice by splitting a delimiter
func TrimPrefix ¶
TrimPrefix trims off a prefix string from all the elements in a given slice
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API - local variables
func (API) AbortMultipartUpload ¶
func (donut API) AbortMultipartUpload(bucket, key, uploadID string, signature *Signature) *probe.Error
AbortMultipartUpload - abort an incomplete multipart session
func (API) AttachNode ¶
AttachNode - attach node
func (API) CompleteMultipartUpload ¶
func (donut API) CompleteMultipartUpload(bucket, key, uploadID string, data io.Reader, signature *Signature) (ObjectMetadata, *probe.Error)
CompleteMultipartUpload - complete a multipart upload and persist the data
func (API) CreateObject ¶
func (donut API) CreateObject(bucket, key, expectedMD5Sum string, size int64, data io.Reader, metadata map[string]string, signature *Signature) (ObjectMetadata, *probe.Error)
CreateObject - create an object
func (API) CreateObjectPart ¶
func (donut API) CreateObjectPart(bucket, key, uploadID string, partID int, contentType, expectedMD5Sum string, size int64, data io.Reader, signature *Signature) (string, *probe.Error)
CreateObjectPart - create a part in a multipart session
func (API) DetachNode ¶
DetachNode - detach node
func (API) GetBucketMetadata ¶
func (donut API) GetBucketMetadata(bucket string, signature *Signature) (BucketMetadata, *probe.Error)
GetBucketMetadata -
func (API) GetObject ¶
func (donut API) GetObject(w io.Writer, bucket string, object string, start, length int64) (int64, *probe.Error)
GetObject - GET object from cache buffer
func (API) GetObjectMetadata ¶
func (donut API) GetObjectMetadata(bucket, key string, signature *Signature) (ObjectMetadata, *probe.Error)
GetObjectMetadata - get object metadata from cache
func (API) ListBuckets ¶
func (donut API) ListBuckets(signature *Signature) ([]BucketMetadata, *probe.Error)
ListBuckets - List buckets from cache
func (API) ListMultipartUploads ¶
func (donut API) ListMultipartUploads(bucket string, resources BucketMultipartResourcesMetadata, signature *Signature) (BucketMultipartResourcesMetadata, *probe.Error)
ListMultipartUploads - list incomplete multipart sessions for a given bucket
func (API) ListObjectParts ¶
func (donut API) ListObjectParts(bucket, key string, resources ObjectResourcesMetadata, signature *Signature) (ObjectResourcesMetadata, *probe.Error)
ListObjectParts - list parts from incomplete multipart session for a given object
func (API) ListObjects ¶
func (donut API) ListObjects(bucket string, resources BucketResourcesMetadata, signature *Signature) ([]ObjectMetadata, BucketResourcesMetadata, *probe.Error)
ListObjects - list objects from cache
func (API) MakeBucket ¶
func (donut API) MakeBucket(bucketName, acl string, location io.Reader, signature *Signature) *probe.Error
MakeBucket - create bucket in cache
func (API) NewMultipartUpload ¶
func (donut API) NewMultipartUpload(bucket, key, contentType string, signature *Signature) (string, *probe.Error)
NewMultipartUpload - initiate a new multipart session
type APINotImplemented ¶
type APINotImplemented struct {
API string
}
APINotImplemented - generic API not implemented error
func (APINotImplemented) Error ¶
func (e APINotImplemented) Error() string
Return string an error formatted as the given text
type AllBuckets ¶
type AllBuckets struct { Version string `json:"version"` Buckets map[string]BucketMetadata `json:"buckets"` }
AllBuckets container for all buckets
type BackendCorrupted ¶
type BackendCorrupted BackendError
BackendCorrupted - path has corrupted data
func (BackendCorrupted) Error ¶
func (e BackendCorrupted) Error() string
Return string an error formatted as the given text
type BackendError ¶
type BackendError struct {
Path string
}
BackendError - generic disk backend error
type BucketACL ¶
type BucketACL string
BucketACL - bucket level access control
func (BucketACL) IsPublicRead ¶
IsPublicRead - is acl PublicRead
func (BucketACL) IsPublicReadWrite ¶
IsPublicReadWrite - is acl PublicReadWrite
type BucketExists ¶
type BucketExists struct {
Bucket string
}
BucketExists bucket exists
func (BucketExists) Error ¶
func (e BucketExists) Error() string
type BucketMetadata ¶
type BucketMetadata struct { Version string `json:"version"` Name string `json:"name"` ACL BucketACL `json:"acl"` Created time.Time `json:"created"` Multiparts map[string]MultiPartSession `json:"multiparts"` Metadata map[string]string `json:"metadata"` BucketObjects map[string]struct{} `json:"objects"` }
BucketMetadata container for bucket level metadata
type BucketMultipartResourcesMetadata ¶
type BucketMultipartResourcesMetadata struct { KeyMarker string UploadIDMarker string NextKeyMarker string NextUploadIDMarker string EncodingType string MaxUploads int IsTruncated bool Upload []*UploadMetadata Prefix string Delimiter string CommonPrefixes []string }
BucketMultipartResourcesMetadata - various types of bucket resources for inprogress multipart uploads
type BucketNameInvalid ¶
type BucketNameInvalid GenericBucketError
BucketNameInvalid - bucketname provided is invalid
func (BucketNameInvalid) Error ¶
func (e BucketNameInvalid) Error() string
Return string an error formatted as the given text
type BucketNotFound ¶
type BucketNotFound struct {
Bucket string
}
BucketNotFound bucket does not exist
func (BucketNotFound) Error ¶
func (e BucketNotFound) Error() string
type BucketResourcesMetadata ¶
type BucketResourcesMetadata struct { Prefix string Marker string NextMarker string Maxkeys int EncodingType string Delimiter string IsTruncated bool CommonPrefixes []string }
BucketResourcesMetadata - various types of bucket resources
type ChecksumMismatch ¶
type ChecksumMismatch struct{}
ChecksumMismatch checksum mismatch
func (ChecksumMismatch) Error ¶
func (e ChecksumMismatch) Error() string
type CloudStorage ¶
type CloudStorage interface { // Storage service operations GetBucketMetadata(bucket string, signature *Signature) (BucketMetadata, *probe.Error) SetBucketMetadata(bucket string, metadata map[string]string, signature *Signature) *probe.Error ListBuckets(signature *Signature) ([]BucketMetadata, *probe.Error) MakeBucket(bucket string, ACL string, location io.Reader, signature *Signature) *probe.Error // Bucket operations ListObjects(string, BucketResourcesMetadata, *Signature) ([]ObjectMetadata, BucketResourcesMetadata, *probe.Error) // Object operations GetObject(w io.Writer, bucket, object string, start, length int64) (int64, *probe.Error) GetObjectMetadata(bucket, object string, signature *Signature) (ObjectMetadata, *probe.Error) // bucket, object, expectedMD5Sum, size, reader, metadata, signature CreateObject(string, string, string, int64, io.Reader, map[string]string, *Signature) (ObjectMetadata, *probe.Error) Multipart }
CloudStorage is a donut cloud storage interface
type CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
Part []CompletePart
}
CompleteMultipartUpload container for completing multipart upload
type CompletePart ¶
CompletePart - completed part container
type Config ¶
type Config struct { Version string `json:"version"` MaxSize uint64 `json:"max-size"` DonutName string `json:"donut-name"` NodeDiskMap map[string][]string `json:"node-disk-map"` }
Config donut config
type CorruptedBackend ¶
type CorruptedBackend struct {
Backend string
}
CorruptedBackend backend found to be corrupted
func (CorruptedBackend) Error ¶
func (e CorruptedBackend) Error() string
type DigestError ¶
DigestError - Generic Md5 error
type EntityTooLarge ¶
type EntityTooLarge struct { GenericObjectError Size string MaxSize string }
EntityTooLarge - object size exceeds maximum limit
func (EntityTooLarge) Error ¶
func (e EntityTooLarge) Error() string
Return string an error formatted as the given text
type GenericBucketError ¶
type GenericBucketError struct {
Bucket string
}
GenericBucketError - generic bucket error
type GenericObjectError ¶
GenericObjectError - generic object error
type ImplementationError ¶
ImplementationError - generic implementation error
func EmbedError ¶
func EmbedError(bucket, object string, err error) ImplementationError
EmbedError - wrapper function for error object
func (ImplementationError) Error ¶
func (e ImplementationError) Error() string
Return string an error formatted as the given text
type IncompleteBody ¶
type IncompleteBody GenericObjectError
IncompleteBody You did not provide the number of bytes specified by the Content-Length HTTP header
func (IncompleteBody) Error ¶
func (e IncompleteBody) Error() string
Return string an error formatted as the given text
type Interface ¶
type Interface interface { CloudStorage Management }
Interface is a collection of cloud storage and management interface
type InternalError ¶
type InternalError struct { }
InternalError - generic internal error
func (InternalError) Error ¶
func (e InternalError) Error() string
Return string an error formatted as the given text
type InvalidACL ¶
type InvalidACL struct {
ACL string
}
InvalidACL - acl invalid
func (InvalidACL) Error ¶
func (e InvalidACL) Error() string
type InvalidArgument ¶
type InvalidArgument struct{}
InvalidArgument invalid argument
func (InvalidArgument) Error ¶
func (e InvalidArgument) Error() string
type InvalidDigest ¶
type InvalidDigest DigestError
InvalidDigest - md5 in request header invalid
func (InvalidDigest) Error ¶
func (e InvalidDigest) Error() string
Return string an error formatted as the given text
type InvalidDisksArgument ¶
type InvalidDisksArgument struct{}
InvalidDisksArgument invalid number of disks per node
func (InvalidDisksArgument) Error ¶
func (e InvalidDisksArgument) Error() string
type InvalidErasureTechnique ¶
type InvalidErasureTechnique struct {
Technique string
}
InvalidErasureTechnique invalid erasure technique
func (InvalidErasureTechnique) Error ¶
func (e InvalidErasureTechnique) Error() string
type InvalidPart ¶
type InvalidPart struct{}
InvalidPart One or more of the specified parts could not be found
func (InvalidPart) Error ¶
func (e InvalidPart) Error() string
type InvalidPartOrder ¶
type InvalidPartOrder struct {
UploadID string
}
InvalidPartOrder parts are not ordered as Requested
func (InvalidPartOrder) Error ¶
func (e InvalidPartOrder) Error() string
type InvalidRange ¶
InvalidRange - invalid range
func (InvalidRange) Error ¶
func (e InvalidRange) Error() string
type InvalidUploadID ¶
type InvalidUploadID struct {
UploadID string
}
InvalidUploadID invalid upload id
func (InvalidUploadID) Error ¶
func (e InvalidUploadID) Error() string
type ListObjectsResults ¶
type ListObjectsResults struct { Objects map[string]ObjectMetadata `json:"objects"` CommonPrefixes []string `json:"commonPrefixes"` IsTruncated bool `json:"isTruncated"` }
ListObjectsResults container for list objects response
type MalformedXML ¶
type MalformedXML struct{}
MalformedXML invalid xml format
func (MalformedXML) Error ¶
func (e MalformedXML) Error() string
type Management ¶
type Management interface { Heal() *probe.Error Rebalance() *probe.Error Info() (map[string][]string, *probe.Error) AttachNode(hostname string, disks []string) *probe.Error DetachNode(hostname string) *probe.Error }
Management is a donut management system interface
type Metadata ¶
type Metadata struct {
Version string `json:"version"`
}
Metadata container for donut metadata
type MissingDateHeader ¶
type MissingDateHeader struct{}
MissingDateHeader date header missing
func (MissingDateHeader) Error ¶
func (e MissingDateHeader) Error() string
type MissingErasureTechnique ¶
type MissingErasureTechnique struct{}
MissingErasureTechnique missing erasure technique
func (MissingErasureTechnique) Error ¶
func (e MissingErasureTechnique) Error() string
type MultiPartSession ¶
type MultiPartSession struct { UploadID string `json:"uploadId"` Initiated time.Time `json:"initiated"` Parts map[string]PartMetadata `json:"parts"` TotalParts int `json:"total-parts"` }
MultiPartSession multipart session
type Multipart ¶
type Multipart interface { NewMultipartUpload(bucket, key, contentType string, signature *Signature) (string, *probe.Error) AbortMultipartUpload(bucket, key, uploadID string, signature *Signature) *probe.Error CreateObjectPart(string, string, string, int, string, string, int64, io.Reader, *Signature) (string, *probe.Error) CompleteMultipartUpload(bucket, key, uploadID string, data io.Reader, signature *Signature) (ObjectMetadata, *probe.Error) ListMultipartUploads(string, BucketMultipartResourcesMetadata, *Signature) (BucketMultipartResourcesMetadata, *probe.Error) ListObjectParts(string, string, ObjectResourcesMetadata, *Signature) (ObjectResourcesMetadata, *probe.Error) }
Multipart API
type NotImplemented ¶
type NotImplemented struct {
Function string
}
NotImplemented function not implemented
func (NotImplemented) Error ¶
func (e NotImplemented) Error() string
type ObjectCorrupted ¶
type ObjectCorrupted struct {
Object string
}
ObjectCorrupted object found to be corrupted
func (ObjectCorrupted) Error ¶
func (e ObjectCorrupted) Error() string
type ObjectExists ¶
type ObjectExists struct {
Object string
}
ObjectExists object exists
func (ObjectExists) Error ¶
func (e ObjectExists) Error() string
type ObjectMetadata ¶
type ObjectMetadata struct { // version Version string `json:"version"` // object metadata Created time.Time `json:"created"` Bucket string `json:"bucket"` Object string `json:"object"` Size int64 `json:"size"` // erasure DataDisks uint8 `json:"sys.erasureK"` ParityDisks uint8 `json:"sys.erasureM"` ErasureTechnique string `json:"sys.erasureTechnique"` BlockSize int `json:"sys.blockSize"` ChunkCount int `json:"sys.chunkCount"` // checksums MD5Sum string `json:"sys.md5sum"` SHA512Sum string `json:"sys.sha512sum"` // metadata Metadata map[string]string `json:"metadata"` }
ObjectMetadata container for object on donut system
type ObjectNameInvalid ¶
type ObjectNameInvalid GenericObjectError
ObjectNameInvalid - object name provided is invalid
func (ObjectNameInvalid) Error ¶
func (e ObjectNameInvalid) Error() string
Return string an error formatted as the given text
type ObjectNotFound ¶
type ObjectNotFound struct {
Object string
}
ObjectNotFound object does not exist
func (ObjectNotFound) Error ¶
func (e ObjectNotFound) Error() string
type ObjectResourcesMetadata ¶
type ObjectResourcesMetadata struct { Bucket string EncodingType string Key string UploadID string StorageClass string PartNumberMarker int NextPartNumberMarker int MaxParts int IsTruncated bool Part []*PartMetadata }
ObjectResourcesMetadata - various types of object resources
type OperationNotPermitted ¶
OperationNotPermitted - operation not permitted
func (OperationNotPermitted) Error ¶
func (e OperationNotPermitted) Error() string
type ParityOverflow ¶
type ParityOverflow struct{}
ParityOverflow parity over flow
func (ParityOverflow) Error ¶
func (e ParityOverflow) Error() string
type PartMetadata ¶
PartMetadata - various types of individual part resources
type ProxyWriter ¶
type ProxyWriter struct {
// contains filtered or unexported fields
}
ProxyWriter implements io.Writer to trap written bytes
func NewProxyWriter ¶
func NewProxyWriter(w io.Writer) *ProxyWriter
NewProxyWriter - wrap around a given writer with ProxyWriter
type Signature ¶
type Signature struct { AccessKeyID string SecretAccessKey string AuthHeader string Request *http.Request }
Signature - local variables
func (*Signature) DoesSignatureMatch ¶
DoesSignatureMatch - Verify authorization header with calculated header in accordance with - http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html returns true if matches, false other wise if error is not nil then it is always false
type SignatureDoesNotMatch ¶
SignatureDoesNotMatch invalid signature
func (SignatureDoesNotMatch) Error ¶
func (e SignatureDoesNotMatch) Error() string
type TooManyBuckets ¶
type TooManyBuckets GenericBucketError
TooManyBuckets - total buckets exceeded
func (TooManyBuckets) Error ¶
func (e TooManyBuckets) Error() string
Return string an error formatted as the given text
type UnsupportedFilesystem ¶
type UnsupportedFilesystem struct {
Type string
}
UnsupportedFilesystem unsupported filesystem type
func (UnsupportedFilesystem) Error ¶
func (e UnsupportedFilesystem) Error() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cache
|
|
data
Package data implements in memory caching methods for data
|
Package data implements in memory caching methods for data |
metadata
Package metadata implements in memory caching methods for metadata information
|
Package metadata implements in memory caching methods for metadata information |