Documentation
¶
Index ¶
- Constants
- Variables
- func CreateExceedingRangeErr(objSize int64) s3err.APIError
- func GetMultipartMD5(parts []types.CompletedPart) string
- func GetStringPtr(s string) *string
- func GetTimePtr(t time.Time) *time.Time
- func IsValidBucketName(name string) bool
- func MkdirAll(path string, uid, gid int, doChown bool) error
- func ParseRange(size int64, acceptRange string) (int64, int64, error)
- type Backend
- type BackendUnsupported
- func (BackendUnsupported) AbortMultipartUpload(context.Context, *s3.AbortMultipartUploadInput) error
- func (BackendUnsupported) ChangeBucketOwner(_ context.Context, bucket string, acl []byte) error
- func (BackendUnsupported) CompleteMultipartUpload(context.Context, *s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error)
- func (BackendUnsupported) CopyObject(context.Context, *s3.CopyObjectInput) (*s3.CopyObjectOutput, error)
- func (BackendUnsupported) CreateBucket(context.Context, *s3.CreateBucketInput, []byte) error
- func (BackendUnsupported) CreateMultipartUpload(context.Context, *s3.CreateMultipartUploadInput) (s3response.InitiateMultipartUploadResult, error)
- func (BackendUnsupported) DeleteBucket(context.Context, *s3.DeleteBucketInput) error
- func (BackendUnsupported) DeleteBucketOwnershipControls(_ context.Context, bucket string) error
- func (BackendUnsupported) DeleteBucketPolicy(_ context.Context, bucket string) error
- func (BackendUnsupported) DeleteBucketTagging(_ context.Context, bucket string) error
- func (BackendUnsupported) DeleteObject(context.Context, *s3.DeleteObjectInput) error
- func (BackendUnsupported) DeleteObjectTagging(_ context.Context, bucket, object string) error
- func (BackendUnsupported) DeleteObjects(context.Context, *s3.DeleteObjectsInput) (s3response.DeleteResult, error)
- func (BackendUnsupported) GetBucketAcl(context.Context, *s3.GetBucketAclInput) ([]byte, error)
- func (BackendUnsupported) GetBucketOwnershipControls(_ context.Context, bucket string) (types.ObjectOwnership, error)
- func (BackendUnsupported) GetBucketPolicy(_ context.Context, bucket string) ([]byte, error)
- func (BackendUnsupported) GetBucketTagging(_ context.Context, bucket string) (map[string]string, error)
- func (BackendUnsupported) GetBucketVersioning(_ context.Context, bucket string) (*s3.GetBucketVersioningOutput, error)
- func (BackendUnsupported) GetObject(context.Context, *s3.GetObjectInput) (*s3.GetObjectOutput, error)
- func (BackendUnsupported) GetObjectAcl(context.Context, *s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error)
- func (BackendUnsupported) GetObjectAttributes(context.Context, *s3.GetObjectAttributesInput) (s3response.GetObjectAttributesResult, error)
- func (BackendUnsupported) GetObjectLegalHold(_ context.Context, bucket, object, versionId string) (*bool, error)
- func (BackendUnsupported) GetObjectLockConfiguration(_ context.Context, bucket string) ([]byte, error)
- func (BackendUnsupported) GetObjectRetention(_ context.Context, bucket, object, versionId string) ([]byte, error)
- func (BackendUnsupported) GetObjectTagging(_ context.Context, bucket, object string) (map[string]string, error)
- func (BackendUnsupported) HeadBucket(context.Context, *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
- func (BackendUnsupported) HeadObject(context.Context, *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
- func (BackendUnsupported) ListBuckets(context.Context, string, bool) (s3response.ListAllMyBucketsResult, error)
- func (BackendUnsupported) ListBucketsAndOwners(context.Context) ([]s3response.Bucket, error)
- func (BackendUnsupported) ListMultipartUploads(context.Context, *s3.ListMultipartUploadsInput) (s3response.ListMultipartUploadsResult, error)
- func (BackendUnsupported) ListObjectVersions(context.Context, *s3.ListObjectVersionsInput) (*s3.ListObjectVersionsOutput, error)
- func (BackendUnsupported) ListObjects(context.Context, *s3.ListObjectsInput) (s3response.ListObjectsResult, error)
- func (BackendUnsupported) ListObjectsV2(context.Context, *s3.ListObjectsV2Input) (s3response.ListObjectsV2Result, error)
- func (BackendUnsupported) ListParts(context.Context, *s3.ListPartsInput) (s3response.ListPartsResult, error)
- func (BackendUnsupported) PutBucketAcl(_ context.Context, bucket string, data []byte) error
- func (BackendUnsupported) PutBucketOwnershipControls(_ context.Context, bucket string, ownership types.ObjectOwnership) error
- func (BackendUnsupported) PutBucketPolicy(_ context.Context, bucket string, policy []byte) error
- func (BackendUnsupported) PutBucketTagging(_ context.Context, bucket string, tags map[string]string) error
- func (BackendUnsupported) PutBucketVersioning(context.Context, *s3.PutBucketVersioningInput) error
- func (BackendUnsupported) PutObject(context.Context, *s3.PutObjectInput) (string, error)
- func (BackendUnsupported) PutObjectAcl(context.Context, *s3.PutObjectAclInput) error
- func (BackendUnsupported) PutObjectLegalHold(_ context.Context, bucket, object, versionId string, status bool) error
- func (BackendUnsupported) PutObjectLockConfiguration(_ context.Context, bucket string, config []byte) error
- func (BackendUnsupported) PutObjectRetention(_ context.Context, bucket, object, versionId string, bypass bool, ...) error
- func (BackendUnsupported) PutObjectTagging(_ context.Context, bucket, object string, tags map[string]string) error
- func (BackendUnsupported) RestoreObject(context.Context, *s3.RestoreObjectInput) error
- func (BackendUnsupported) SelectObjectContent(ctx context.Context, input *s3.SelectObjectContentInput) func(w *bufio.Writer)
- func (BackendUnsupported) Shutdown()
- func (BackendUnsupported) String() string
- func (BackendUnsupported) UploadPart(context.Context, *s3.UploadPartInput) (etag string, err error)
- func (BackendUnsupported) UploadPartCopy(context.Context, *s3.UploadPartCopyInput) (s3response.CopyObjectResult, error)
- type ByBucketName
- type ByObjectName
- type FileSectionReadCloser
- type GetObjFunc
- type WalkResults
Constants ¶
View Source
const ( // this is the media type for directories in AWS and Nextcloud DirContentType = "application/x-directory" DefaultContentType = "binary/octet-stream" )
Variables ¶
View Source
var ErrSkipObj = errors.New("skip this object")
Functions ¶
func CreateExceedingRangeErr ¶ added in v1.0.2
func GetMultipartMD5 ¶
func GetMultipartMD5(parts []types.CompletedPart) string
func GetStringPtr ¶
func IsValidBucketName ¶
func MkdirAll ¶
MkdirAll is similar to os.MkdirAll but it will return ErrObjectParentIsFile when appropriate MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm (before umask) are used for all directories that MkdirAll creates. Any newly created directory is set to provided uid/gid ownership. If path is already a directory, MkdirAll does nothing and returns nil. Any directory created will be set to provided uid/gid ownership if doChown is true.
Types ¶
type Backend ¶
type Backend interface {
fmt.Stringer
Shutdown()
// bucket operations
ListBuckets(_ context.Context, owner string, isAdmin bool) (s3response.ListAllMyBucketsResult, error)
HeadBucket(context.Context, *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
GetBucketAcl(context.Context, *s3.GetBucketAclInput) ([]byte, error)
CreateBucket(_ context.Context, _ *s3.CreateBucketInput, defaultACL []byte) error
PutBucketAcl(_ context.Context, bucket string, data []byte) error
DeleteBucket(context.Context, *s3.DeleteBucketInput) error
PutBucketVersioning(context.Context, *s3.PutBucketVersioningInput) error
GetBucketVersioning(_ context.Context, bucket string) (*s3.GetBucketVersioningOutput, error)
PutBucketPolicy(_ context.Context, bucket string, policy []byte) error
GetBucketPolicy(_ context.Context, bucket string) ([]byte, error)
DeleteBucketPolicy(_ context.Context, bucket string) error
PutBucketOwnershipControls(_ context.Context, bucket string, ownership types.ObjectOwnership) error
GetBucketOwnershipControls(_ context.Context, bucket string) (types.ObjectOwnership, error)
DeleteBucketOwnershipControls(_ context.Context, bucket string) error
// multipart operations
CreateMultipartUpload(context.Context, *s3.CreateMultipartUploadInput) (s3response.InitiateMultipartUploadResult, error)
CompleteMultipartUpload(context.Context, *s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error)
AbortMultipartUpload(context.Context, *s3.AbortMultipartUploadInput) error
ListMultipartUploads(context.Context, *s3.ListMultipartUploadsInput) (s3response.ListMultipartUploadsResult, error)
ListParts(context.Context, *s3.ListPartsInput) (s3response.ListPartsResult, error)
UploadPart(context.Context, *s3.UploadPartInput) (etag string, err error)
UploadPartCopy(context.Context, *s3.UploadPartCopyInput) (s3response.CopyObjectResult, error)
// standard object operations
PutObject(context.Context, *s3.PutObjectInput) (string, error)
HeadObject(context.Context, *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
GetObject(context.Context, *s3.GetObjectInput) (*s3.GetObjectOutput, error)
GetObjectAcl(context.Context, *s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error)
GetObjectAttributes(context.Context, *s3.GetObjectAttributesInput) (s3response.GetObjectAttributesResult, error)
CopyObject(context.Context, *s3.CopyObjectInput) (*s3.CopyObjectOutput, error)
ListObjects(context.Context, *s3.ListObjectsInput) (s3response.ListObjectsResult, error)
ListObjectsV2(context.Context, *s3.ListObjectsV2Input) (s3response.ListObjectsV2Result, error)
DeleteObject(context.Context, *s3.DeleteObjectInput) error
DeleteObjects(context.Context, *s3.DeleteObjectsInput) (s3response.DeleteResult, error)
PutObjectAcl(context.Context, *s3.PutObjectAclInput) error
ListObjectVersions(context.Context, *s3.ListObjectVersionsInput) (*s3.ListObjectVersionsOutput, error)
// special case object operations
RestoreObject(context.Context, *s3.RestoreObjectInput) error
SelectObjectContent(ctx context.Context, input *s3.SelectObjectContentInput) func(w *bufio.Writer)
// bucket tagging operations
GetBucketTagging(_ context.Context, bucket string) (map[string]string, error)
PutBucketTagging(_ context.Context, bucket string, tags map[string]string) error
DeleteBucketTagging(_ context.Context, bucket string) error
// object tagging operations
GetObjectTagging(_ context.Context, bucket, object string) (map[string]string, error)
PutObjectTagging(_ context.Context, bucket, object string, tags map[string]string) error
DeleteObjectTagging(_ context.Context, bucket, object string) error
// object lock operations
PutObjectLockConfiguration(_ context.Context, bucket string, config []byte) error
GetObjectLockConfiguration(_ context.Context, bucket string) ([]byte, error)
PutObjectRetention(_ context.Context, bucket, object, versionId string, bypass bool, retention []byte) error
GetObjectRetention(_ context.Context, bucket, object, versionId string) ([]byte, error)
PutObjectLegalHold(_ context.Context, bucket, object, versionId string, status bool) error
GetObjectLegalHold(_ context.Context, bucket, object, versionId string) (*bool, error)
// non AWS actions
ChangeBucketOwner(_ context.Context, bucket string, acl []byte) error
ListBucketsAndOwners(context.Context) ([]s3response.Bucket, error)
}
type BackendUnsupported ¶
type BackendUnsupported struct{}
func (BackendUnsupported) AbortMultipartUpload ¶
func (BackendUnsupported) AbortMultipartUpload(context.Context, *s3.AbortMultipartUploadInput) error
func (BackendUnsupported) ChangeBucketOwner ¶
func (BackendUnsupported) CompleteMultipartUpload ¶
func (BackendUnsupported) CompleteMultipartUpload(context.Context, *s3.CompleteMultipartUploadInput) (*s3.CompleteMultipartUploadOutput, error)
func (BackendUnsupported) CopyObject ¶
func (BackendUnsupported) CopyObject(context.Context, *s3.CopyObjectInput) (*s3.CopyObjectOutput, error)
func (BackendUnsupported) CreateBucket ¶
func (BackendUnsupported) CreateBucket(context.Context, *s3.CreateBucketInput, []byte) error
func (BackendUnsupported) CreateMultipartUpload ¶
func (BackendUnsupported) CreateMultipartUpload(context.Context, *s3.CreateMultipartUploadInput) (s3response.InitiateMultipartUploadResult, error)
func (BackendUnsupported) DeleteBucket ¶
func (BackendUnsupported) DeleteBucket(context.Context, *s3.DeleteBucketInput) error
func (BackendUnsupported) DeleteBucketOwnershipControls ¶ added in v1.0.3
func (BackendUnsupported) DeleteBucketOwnershipControls(_ context.Context, bucket string) error
func (BackendUnsupported) DeleteBucketPolicy ¶
func (BackendUnsupported) DeleteBucketPolicy(_ context.Context, bucket string) error
func (BackendUnsupported) DeleteBucketTagging ¶
func (BackendUnsupported) DeleteBucketTagging(_ context.Context, bucket string) error
func (BackendUnsupported) DeleteObject ¶
func (BackendUnsupported) DeleteObject(context.Context, *s3.DeleteObjectInput) error
func (BackendUnsupported) DeleteObjectTagging ¶
func (BackendUnsupported) DeleteObjectTagging(_ context.Context, bucket, object string) error
func (BackendUnsupported) DeleteObjects ¶
func (BackendUnsupported) DeleteObjects(context.Context, *s3.DeleteObjectsInput) (s3response.DeleteResult, error)
func (BackendUnsupported) GetBucketAcl ¶
func (BackendUnsupported) GetBucketAcl(context.Context, *s3.GetBucketAclInput) ([]byte, error)
func (BackendUnsupported) GetBucketOwnershipControls ¶ added in v1.0.3
func (BackendUnsupported) GetBucketOwnershipControls(_ context.Context, bucket string) (types.ObjectOwnership, error)
func (BackendUnsupported) GetBucketPolicy ¶
func (BackendUnsupported) GetBucketTagging ¶
func (BackendUnsupported) GetBucketVersioning ¶
func (BackendUnsupported) GetBucketVersioning(_ context.Context, bucket string) (*s3.GetBucketVersioningOutput, error)
func (BackendUnsupported) GetObject ¶
func (BackendUnsupported) GetObject(context.Context, *s3.GetObjectInput) (*s3.GetObjectOutput, error)
func (BackendUnsupported) GetObjectAcl ¶
func (BackendUnsupported) GetObjectAcl(context.Context, *s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error)
func (BackendUnsupported) GetObjectAttributes ¶
func (BackendUnsupported) GetObjectAttributes(context.Context, *s3.GetObjectAttributesInput) (s3response.GetObjectAttributesResult, error)
func (BackendUnsupported) GetObjectLegalHold ¶
func (BackendUnsupported) GetObjectLockConfiguration ¶
func (BackendUnsupported) GetObjectRetention ¶
func (BackendUnsupported) GetObjectTagging ¶
func (BackendUnsupported) HeadBucket ¶
func (BackendUnsupported) HeadBucket(context.Context, *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
func (BackendUnsupported) HeadObject ¶
func (BackendUnsupported) HeadObject(context.Context, *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
func (BackendUnsupported) ListBuckets ¶
func (BackendUnsupported) ListBuckets(context.Context, string, bool) (s3response.ListAllMyBucketsResult, error)
func (BackendUnsupported) ListBucketsAndOwners ¶
func (BackendUnsupported) ListBucketsAndOwners(context.Context) ([]s3response.Bucket, error)
func (BackendUnsupported) ListMultipartUploads ¶
func (BackendUnsupported) ListMultipartUploads(context.Context, *s3.ListMultipartUploadsInput) (s3response.ListMultipartUploadsResult, error)
func (BackendUnsupported) ListObjectVersions ¶
func (BackendUnsupported) ListObjectVersions(context.Context, *s3.ListObjectVersionsInput) (*s3.ListObjectVersionsOutput, error)
func (BackendUnsupported) ListObjects ¶
func (BackendUnsupported) ListObjects(context.Context, *s3.ListObjectsInput) (s3response.ListObjectsResult, error)
func (BackendUnsupported) ListObjectsV2 ¶
func (BackendUnsupported) ListObjectsV2(context.Context, *s3.ListObjectsV2Input) (s3response.ListObjectsV2Result, error)
func (BackendUnsupported) ListParts ¶
func (BackendUnsupported) ListParts(context.Context, *s3.ListPartsInput) (s3response.ListPartsResult, error)
func (BackendUnsupported) PutBucketAcl ¶
func (BackendUnsupported) PutBucketOwnershipControls ¶ added in v1.0.3
func (BackendUnsupported) PutBucketOwnershipControls(_ context.Context, bucket string, ownership types.ObjectOwnership) error
func (BackendUnsupported) PutBucketPolicy ¶
func (BackendUnsupported) PutBucketTagging ¶
func (BackendUnsupported) PutBucketVersioning ¶
func (BackendUnsupported) PutBucketVersioning(context.Context, *s3.PutBucketVersioningInput) error
func (BackendUnsupported) PutObject ¶
func (BackendUnsupported) PutObject(context.Context, *s3.PutObjectInput) (string, error)
func (BackendUnsupported) PutObjectAcl ¶
func (BackendUnsupported) PutObjectAcl(context.Context, *s3.PutObjectAclInput) error
func (BackendUnsupported) PutObjectLegalHold ¶
func (BackendUnsupported) PutObjectLockConfiguration ¶
func (BackendUnsupported) PutObjectRetention ¶
func (BackendUnsupported) PutObjectTagging ¶
func (BackendUnsupported) RestoreObject ¶
func (BackendUnsupported) RestoreObject(context.Context, *s3.RestoreObjectInput) error
func (BackendUnsupported) SelectObjectContent ¶
func (BackendUnsupported) SelectObjectContent(ctx context.Context, input *s3.SelectObjectContentInput) func(w *bufio.Writer)
func (BackendUnsupported) Shutdown ¶
func (BackendUnsupported) Shutdown()
func (BackendUnsupported) String ¶
func (BackendUnsupported) String() string
func (BackendUnsupported) UploadPart ¶
func (BackendUnsupported) UploadPart(context.Context, *s3.UploadPartInput) (etag string, err error)
func (BackendUnsupported) UploadPartCopy ¶
func (BackendUnsupported) UploadPartCopy(context.Context, *s3.UploadPartCopyInput) (s3response.CopyObjectResult, error)
type ByBucketName ¶
type ByBucketName []s3response.ListAllMyBucketsEntry
func (ByBucketName) Len ¶
func (d ByBucketName) Len() int
func (ByBucketName) Less ¶
func (d ByBucketName) Less(i, j int) bool
func (ByBucketName) Swap ¶
func (d ByBucketName) Swap(i, j int)
type ByObjectName ¶
func (ByObjectName) Len ¶
func (d ByObjectName) Len() int
func (ByObjectName) Less ¶
func (d ByObjectName) Less(i, j int) bool
func (ByObjectName) Swap ¶
func (d ByObjectName) Swap(i, j int)
type FileSectionReadCloser ¶ added in v1.0.3
func (*FileSectionReadCloser) Close ¶ added in v1.0.3
func (f *FileSectionReadCloser) Close() error
type GetObjFunc ¶
type WalkResults ¶
type WalkResults struct {
CommonPrefixes []types.CommonPrefix
Objects []s3response.Object
Truncated bool
NextMarker string
}
Click to show internal directories.
Click to hide internal directories.