Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidBucket(bucket string) bool
- func IsValidBucketACL(acl string) bool
- func IsValidObjectName(object string) bool
- func RemoveAllDirs(path string) error
- func SaveMultipartsSession(multiparts *Multiparts) *probe.Error
- func SetFSConfigPath(configPath string)
- func SetFSMultipartsConfigPath(configPath string)
- func Walk(root string, walkFn WalkFunc) error
- func WalkUnsorted(root string, walkFn WalkFunc) error
- type APINotImplemented
- type BackendCorrupted
- type BackendError
- type BadDigest
- type BucketACL
- type BucketExists
- type BucketMetadata
- type BucketMultipartResourcesMetadata
- type BucketNameInvalid
- type BucketNotEmpty
- type BucketNotFound
- type BucketResourcesMetadata
- type ChecksumMismatch
- type CompleteMultipartUpload
- type CompletePart
- type CorruptedBackend
- type DigestError
- type EntityTooLarge
- type ExpiredPresignedRequest
- type Filesystem
- func (fs Filesystem) AbortMultipartUpload(bucket, object, uploadID string) *probe.Error
- func (fs Filesystem) AutoExpiryThread(expiry time.Duration)
- func (fs Filesystem) CompleteMultipartUpload(bucket, object, uploadID string, data io.Reader, signature *Signature) (ObjectMetadata, *probe.Error)
- func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size int64, data io.Reader, ...) (ObjectMetadata, *probe.Error)
- func (fs Filesystem) CreateObjectPart(bucket, object, uploadID, expectedMD5Sum string, partID int, size int64, ...) (string, *probe.Error)
- func (fs Filesystem) DeleteBucket(bucket string) *probe.Error
- func (fs Filesystem) DeleteObject(bucket, object string) *probe.Error
- func (fs Filesystem) GetBucketMetadata(bucket string) (BucketMetadata, *probe.Error)
- func (fs Filesystem) GetObject(w io.Writer, bucket, object string, start, length int64) (int64, *probe.Error)
- func (fs Filesystem) GetObjectMetadata(bucket, object string) (ObjectMetadata, *probe.Error)
- func (fs Filesystem) IsPrivateBucket(bucket string) bool
- func (fs Filesystem) IsPublicBucket(bucket string) bool
- func (fs Filesystem) IsReadOnlyBucket(bucket string) bool
- func (fs Filesystem) ListBuckets() ([]BucketMetadata, *probe.Error)
- func (fs Filesystem) ListMultipartUploads(bucket string, resources BucketMultipartResourcesMetadata) (BucketMultipartResourcesMetadata, *probe.Error)
- func (fs Filesystem) ListObjectParts(bucket, object string, resources ObjectResourcesMetadata) (ObjectResourcesMetadata, *probe.Error)
- func (fs Filesystem) ListObjects(bucket string, resources BucketResourcesMetadata) ([]ObjectMetadata, BucketResourcesMetadata, *probe.Error)
- func (fs Filesystem) MakeBucket(bucket, acl string) *probe.Error
- func (fs Filesystem) NewMultipartUpload(bucket, object string) (string, *probe.Error)
- func (fs Filesystem) SetBucketMetadata(bucket string, metadata map[string]string) *probe.Error
- func (fs *Filesystem) SetMinFreeDisk(minFreeDisk int64)
- func (fs *Filesystem) SetRootPath(path string)
- type GenericBucketError
- type GenericObjectError
- type ImplementationError
- type IncompleteBody
- type InternalError
- type InvalidACL
- type InvalidArgument
- type InvalidDigest
- type InvalidDisksArgument
- type InvalidPart
- type InvalidPartOrder
- type InvalidRange
- type InvalidUploadID
- type MalformedXML
- type Metadata
- type MissingDateHeader
- type MissingExpiresQuery
- type MissingPOSTPolicy
- type MultipartSession
- type Multiparts
- type NotImplemented
- type ObjectCorrupted
- type ObjectMetadata
- type ObjectNameInvalid
- type ObjectNotFound
- type ObjectResourcesMetadata
- type OperationNotPermitted
- type ParityOverflow
- type PartMetadata
- type PostPolicyForm
- type RootPathFull
- type Signature
- type SignatureDoesNotMatch
- type UnsupportedFilesystem
- type UploadMetadata
- type WalkFunc
Constants ¶
const ( BucketPrivate = BucketACL("private") BucketPublicRead = BucketACL("public-read") BucketPublicReadWrite = BucketACL("public-read-write") )
different types of ACL's currently supported for buckets
Variables ¶
var ErrDirNotEmpty = errors.New("directory not empty")
ErrDirNotEmpty is used to throw error on directories which have atleast one regular file or a symlink left
var ErrSkipDir = errors.New("skip this directory")
ErrSkipDir is used as a return value from WalkFuncs to indicate that the directory named in the call is to be skipped. It is not returned as an error by any function.
var ErrSkipFile = errors.New("skip this file")
ErrSkipFile is used as a return value from WalkFuncs to indicate that the file named in the call is to be skipped. It is not returned as an error by any function.
Functions ¶
func IsValidBucket ¶
IsValidBucket - verify bucket name in accordance with
func IsValidBucketACL ¶
IsValidBucketACL - is provided acl string supported
func IsValidObjectName ¶
IsValidObjectName - verify object name in accordance with
func RemoveAllDirs ¶
RemoveAllDirs - removes only itself and all subdirectories
func SaveMultipartsSession ¶
func SaveMultipartsSession(multiparts *Multiparts) *probe.Error
SaveMultipartsSession - save multiparts
func SetFSConfigPath ¶
func SetFSConfigPath(configPath string)
SetFSConfigPath - set custom fs config path
func SetFSMultipartsConfigPath ¶
func SetFSMultipartsConfigPath(configPath string)
SetFSMultipartsConfigPath - set custom multiparts session config path
func Walk ¶
Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root.
func WalkUnsorted ¶
WalkUnsorted walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root.
Types ¶
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 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 ¶
BucketMetadata - name and create date
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 BucketNotEmpty ¶
type BucketNotEmpty struct {
Bucket string
}
BucketNotEmpty bucket is not empty
func (BucketNotEmpty) Error ¶
func (e BucketNotEmpty) Error() string
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 CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
Part []CompletePart
}
CompleteMultipartUpload container for completing multipart upload
type CompletePart ¶
CompletePart - completed part container
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 ExpiredPresignedRequest ¶
type ExpiredPresignedRequest struct{}
ExpiredPresignedRequest request already expired
func (ExpiredPresignedRequest) Error ¶
func (e ExpiredPresignedRequest) Error() string
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
Filesystem - local variables
func (Filesystem) AbortMultipartUpload ¶
func (fs Filesystem) AbortMultipartUpload(bucket, object, uploadID string) *probe.Error
AbortMultipartUpload - abort an incomplete multipart session
func (Filesystem) AutoExpiryThread ¶
func (fs Filesystem) AutoExpiryThread(expiry time.Duration)
AutoExpiryThread - auto expiry thread
func (Filesystem) CompleteMultipartUpload ¶
func (fs Filesystem) CompleteMultipartUpload(bucket, object, uploadID string, data io.Reader, signature *Signature) (ObjectMetadata, *probe.Error)
CompleteMultipartUpload - complete a multipart upload and persist the data
func (Filesystem) CreateObject ¶
func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size int64, data io.Reader, signature *Signature) (ObjectMetadata, *probe.Error)
CreateObject - PUT object
func (Filesystem) CreateObjectPart ¶
func (fs Filesystem) CreateObjectPart(bucket, object, uploadID, expectedMD5Sum string, partID int, size int64, data io.Reader, signature *Signature) (string, *probe.Error)
CreateObjectPart - create a part in a multipart session
func (Filesystem) DeleteBucket ¶
func (fs Filesystem) DeleteBucket(bucket string) *probe.Error
DeleteBucket - delete bucket
func (Filesystem) DeleteObject ¶
func (fs Filesystem) DeleteObject(bucket, object string) *probe.Error
DeleteObject - delete and object
func (Filesystem) GetBucketMetadata ¶
func (fs Filesystem) GetBucketMetadata(bucket string) (BucketMetadata, *probe.Error)
GetBucketMetadata - get bucket metadata
func (Filesystem) GetObject ¶
func (fs Filesystem) GetObject(w io.Writer, bucket, object string, start, length int64) (int64, *probe.Error)
GetObject - GET object
func (Filesystem) GetObjectMetadata ¶
func (fs Filesystem) GetObjectMetadata(bucket, object string) (ObjectMetadata, *probe.Error)
GetObjectMetadata - HEAD object
func (Filesystem) IsPrivateBucket ¶
func (fs Filesystem) IsPrivateBucket(bucket string) bool
IsPrivateBucket - is private bucket
func (Filesystem) IsPublicBucket ¶
func (fs Filesystem) IsPublicBucket(bucket string) bool
IsPublicBucket - is public bucket
func (Filesystem) IsReadOnlyBucket ¶
func (fs Filesystem) IsReadOnlyBucket(bucket string) bool
IsReadOnlyBucket - is read only bucket
func (Filesystem) ListBuckets ¶
func (fs Filesystem) ListBuckets() ([]BucketMetadata, *probe.Error)
ListBuckets - Get service
func (Filesystem) ListMultipartUploads ¶
func (fs Filesystem) ListMultipartUploads(bucket string, resources BucketMultipartResourcesMetadata) (BucketMultipartResourcesMetadata, *probe.Error)
ListMultipartUploads - list incomplete multipart sessions for a given BucketMultipartResourcesMetadata
func (Filesystem) ListObjectParts ¶
func (fs Filesystem) ListObjectParts(bucket, object string, resources ObjectResourcesMetadata) (ObjectResourcesMetadata, *probe.Error)
ListObjectParts - list parts from incomplete multipart session for a given ObjectResourcesMetadata
func (Filesystem) ListObjects ¶
func (fs Filesystem) ListObjects(bucket string, resources BucketResourcesMetadata) ([]ObjectMetadata, BucketResourcesMetadata, *probe.Error)
ListObjects - GET bucket (list objects)
func (Filesystem) MakeBucket ¶
func (fs Filesystem) MakeBucket(bucket, acl string) *probe.Error
MakeBucket - PUT Bucket
func (Filesystem) NewMultipartUpload ¶
func (fs Filesystem) NewMultipartUpload(bucket, object string) (string, *probe.Error)
NewMultipartUpload - initiate a new multipart session
func (Filesystem) SetBucketMetadata ¶
SetBucketMetadata - set bucket metadata
func (*Filesystem) SetMinFreeDisk ¶
func (fs *Filesystem) SetMinFreeDisk(minFreeDisk int64)
SetMinFreeDisk - set min free disk
func (*Filesystem) SetRootPath ¶
func (fs *Filesystem) SetRootPath(path string)
SetRootPath - set root path
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 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 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 MalformedXML ¶
type MalformedXML struct{}
MalformedXML invalid xml format
func (MalformedXML) Error ¶
func (e MalformedXML) Error() string
type MissingDateHeader ¶
type MissingDateHeader struct{}
MissingDateHeader date header missing
func (MissingDateHeader) Error ¶
func (e MissingDateHeader) Error() string
type MissingExpiresQuery ¶
type MissingExpiresQuery struct{}
MissingExpiresQuery expires query string missing
func (MissingExpiresQuery) Error ¶
func (e MissingExpiresQuery) Error() string
type MissingPOSTPolicy ¶
type MissingPOSTPolicy struct{}
MissingPOSTPolicy missing post policy
func (MissingPOSTPolicy) Error ¶
func (e MissingPOSTPolicy) Error() string
type MultipartSession ¶
type MultipartSession struct { TotalParts int UploadID string Initiated time.Time Parts []*PartMetadata }
MultipartSession holds active session information
type Multiparts ¶
type Multiparts struct { Version string `json:"version"` ActiveSession map[string]*MultipartSession `json:"activeSessions"` }
Multiparts collection of many parts
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 ObjectMetadata ¶
type ObjectMetadata struct { Bucket string Object string ContentType string Created time.Time Mode os.FileMode Md5 string Size int64 }
ObjectMetadata - object key and its relevant metadata
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 ¶
ObjectNotFound object does not exist
func (ObjectNotFound) Error ¶
func (e ObjectNotFound) Error() string
type ObjectResourcesMetadata ¶
type ObjectResourcesMetadata struct { Bucket string Object string UploadID string StorageClass string PartNumberMarker int NextPartNumberMarker int MaxParts int IsTruncated bool Part []*PartMetadata EncodingType string }
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 PostPolicyForm ¶
type PostPolicyForm struct { Expiration time.Time // Expiration date and time of the POST policy. Conditions struct { Policies map[string]struct { Operator string Value string } ContentLengthRange struct { Min int Max int } } }
PostPolicyForm provides strict static type conversion and validation for Amazon S3's POST policy JSON string.
func ParsePostPolicyForm ¶
func ParsePostPolicyForm(policy string) (PostPolicyForm, *probe.Error)
ParsePostPolicyForm - Parse JSON policy string into typed POostPolicyForm structure.
type RootPathFull ¶
type RootPathFull struct {
Path string
}
RootPathFull root path out of space
func (RootPathFull) Error ¶
func (e RootPathFull) Error() string
type Signature ¶
type Signature struct { AccessKeyID string SecretAccessKey string Presigned bool PresignedPolicy string SignedHeaders []string Signature string Request *http.Request }
Signature - local variables
func (*Signature) DoesPolicySignatureMatch ¶
DoesPolicySignatureMatch - Verify query headers with post policy
returns true if matches, false otherwise. if error is not nil then it is always false
func (*Signature) DoesPresignedSignatureMatch ¶
DoesPresignedSignatureMatch - Verify query headers with presigned signature
returns true if matches, false otherwise. if error is not nil then it is always false
func (*Signature) DoesSignatureMatch ¶
DoesSignatureMatch - Verify authorization header with calculated header in accordance with
returns true if matches, false otherwise. if error is not nil then it is always false
type SignatureDoesNotMatch ¶
SignatureDoesNotMatch invalid signature
func (SignatureDoesNotMatch) Error ¶
func (e SignatureDoesNotMatch) Error() string
type UnsupportedFilesystem ¶
type UnsupportedFilesystem struct {
Type string
}
UnsupportedFilesystem unsupported filesystem type
func (UnsupportedFilesystem) Error ¶
func (e UnsupportedFilesystem) Error() string
type UploadMetadata ¶
type UploadMetadata struct { Object string UploadID string StorageClass string Initiated time.Time }
UploadMetadata container capturing metadata on in progress multipart upload in a given bucket
type WalkFunc ¶
WalkFunc is the type of the function called for each file or directory visited by Walk. The path argument contains the argument to Walk as a prefix; that is, if Walk is called with "dir", which is a directory containing the file "a", the walk function will be called with argument "dir/a". The info argument is the os.FileInfo for the named path.