Documentation ¶
Overview ¶
Package s3 provides Amazon S3 compatibility layer
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package s3 provides Amazon S3 compatibility layer
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package s3 provides Amazon S3 compatibility layer
- Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
Package s3 provides Amazon S3 compatibility layer
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package s3 provides Amazon S3 compatibility layer
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package s3 provides Amazon S3 compatibility layer
- Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
Index ¶
- Constants
- func AddPart(id string, npart *MptPart) (err error)
- func FillMsgFromS3Query(query url.Values, msg *apc.LsoMsg)
- func FinishUpload(id, fqn string, aborted bool) (exists bool)
- func Init()
- func InitUpload(id, bckName, objName string)
- func ObjName(items []string) string
- func ObjSize(id string) (size int64, err error)
- func OffsetSorted(lom *cluster.LOM, partNum int64) (off, size int64, status int, err error)
- func ParsePartNum(s string) (partNum int64, err error)
- func SetETag(header http.Header, lom *cluster.LOM)
- func WriteErr(w http.ResponseWriter, r *http.Request, err error, errCode int)
- type BckOwner
- type Bucket
- type CommonPrefix
- type CompleteMptUpload
- type CompleteMptUploadResult
- type CopyObjectResult
- type Delete
- type DeleteObjectInfo
- type DeleteResult
- type DeletedObjInfo
- type Error
- type InitiateMptUploadResult
- type ListBucketResult
- type ListMptUploadsResult
- type ListObjectResult
- type ListPartsResult
- type MptPart
- type ObjInfo
- type PartInfo
- type UploadInfoResult
- type VersioningConfiguration
Constants ¶
const ( // AWS URL params QparamVersioning = "versioning" QparamLifecycle = "lifecycle" QparamCORS = "cors" QparamPolicy = "policy" QparamACL = "acl" QparamMultiDelete = "delete" QparamMaxKeys = "max-keys" QparamPrefix = "prefix" QparamContinuationToken = "continuation-token" QparamStartAfter = "start-after" QparamDelimiter = "delimiter" // multipart QparamMptUploads = "uploads" QparamMptUploadID = "uploadId" QparamMptPartNo = "partNumber" QparamMptMaxUploads = "max-uploads" QparamMptUploadIDMarker = "upload-id-marker" // Maximum number of parts per upload // https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html MaxPartsPerUpload = 10000 AISRegion = "ais" AISServer = "AIStore" )
Variables ¶
This section is empty.
Functions ¶
func AddPart ¶
Add part to an active upload. Some clients may omit size and md5. Only partNum is must-have. md5 and fqn is filled by a target after successful saving the data to a workfile.
func FinishUpload ¶
remove all temp files and delete from the map if completed (i.e., not aborted): store xattr
func ObjSize ¶
Return a sum of upload part sizes. Used on upload completion to calculate the final size of the object.
func OffsetSorted ¶
func ParsePartNum ¶
Types ¶
type CommonPrefix ¶
type CommonPrefix struct {
Prefix string `xml:"Prefix"`
}
NOTE: do not rename structs that have `xml` tags. The names of those structs become a top level tag of resulting XML, and those tags S3-compatible clients require.
type CompleteMptUpload ¶
type CompleteMptUpload struct {
Parts []*PartInfo `xml:"Part"`
}
Multipart upload completion request
type CompleteMptUploadResult ¶
type CompleteMptUploadResult struct { Bucket string `xml:"Bucket"` Key string `xml:"Key"` ETag string `xml:"ETag"` }
Multipart upload completion response
func (*CompleteMptUploadResult) MustMarshal ¶
func (r *CompleteMptUploadResult) MustMarshal(sgl *memsys.SGL)
type CopyObjectResult ¶
type CopyObjectResult struct { LastModified string `xml:"LastModified"` // e.g. <LastModified>2009-10-12T17:50:30.000Z</LastModified> ETag string `xml:"ETag"` }
Response for object copy request
func (*CopyObjectResult) MustMarshal ¶
func (r *CopyObjectResult) MustMarshal(sgl *memsys.SGL)
type Delete ¶
type Delete struct { Object []*DeleteObjectInfo `xml:"Object"` Quiet bool `xml:"Quiet"` }
Multiple object delete request
type DeleteObjectInfo ¶
type DeleteResult ¶
type DeleteResult struct {
Objs []DeletedObjInfo `xml:"Deleted"`
}
NOTE: do not rename structs that have `xml` tags. The names of those structs become a top level tag of resulting XML, and those tags S3-compatible clients require.
func (*DeleteResult) MustMarshal ¶
func (r *DeleteResult) MustMarshal(sgl *memsys.SGL)
type DeletedObjInfo ¶
type DeletedObjInfo struct {
Key string `xml:"Key"`
}
Deleted result: list of deleted objects and errors
type InitiateMptUploadResult ¶
type InitiateMptUploadResult struct { Bucket string `xml:"Bucket"` Key string `xml:"Key"` UploadID string `xml:"UploadId"` }
Multipart upload start response
func (*InitiateMptUploadResult) MustMarshal ¶
func (r *InitiateMptUploadResult) MustMarshal(sgl *memsys.SGL)
type ListBucketResult ¶
type ListBucketResult struct { Ns string `xml:"xmlns,attr"` Owner BckOwner `xml:"Owner"` Buckets []*Bucket `xml:"Buckets>Bucket"` }
List bucket response
func NewListBucketResult ¶
func NewListBucketResult() (r *ListBucketResult)
func (*ListBucketResult) Add ¶
func (r *ListBucketResult) Add(bck *meta.Bck)
func (*ListBucketResult) MustMarshal ¶
func (r *ListBucketResult) MustMarshal(sgl *memsys.SGL)
type ListMptUploadsResult ¶
type ListMptUploadsResult struct { Bucket string `xml:"Bucket"` UploadIDMarker string `xml:"UploadIdMarker"` Uploads []UploadInfoResult `xml:"Upload"` MaxUploads int IsTruncated bool }
List of active multipart uploads response
func ListUploads ¶
func ListUploads(bckName, idMarker string, maxUploads int) (result *ListMptUploadsResult)
func (*ListMptUploadsResult) MustMarshal ¶
func (r *ListMptUploadsResult) MustMarshal(sgl *memsys.SGL)
type ListObjectResult ¶
type ListObjectResult struct { Name string `xml:"Name"` Ns string `xml:"xmlns,attr"` Prefix string `xml:"Prefix"` KeyCount int `xml:"KeyCount"` // number of object names in the response MaxKeys int `xml:"MaxKeys"` // "The maximum number of keys returned ..." (s3) IsTruncated bool `xml:"IsTruncated"` // true if there are more pages to read ContinuationToken string `xml:"ContinuationToken"` // original ContinuationToken NextContinuationToken string `xml:"NextContinuationToken"` // NextContinuationToken to read the next page Contents []*ObjInfo `xml:"Contents"` // list of objects CommonPrefixes []*CommonPrefix `xml:"CommonPrefixes,omitempty"` // list of dirs (used with `apc.LsNoRecursion`) }
List objects response
func NewListObjectResult ¶
func NewListObjectResult(bucket string) *ListObjectResult
func (*ListObjectResult) Add ¶
func (r *ListObjectResult) Add(entry *cmn.LsoEntry, lsmsg *apc.LsoMsg)
func (*ListObjectResult) FillFromAisBckList ¶
func (r *ListObjectResult) FillFromAisBckList(bckList *cmn.LsoResult, lsmsg *apc.LsoMsg)
func (*ListObjectResult) MustMarshal ¶
func (r *ListObjectResult) MustMarshal(sgl *memsys.SGL)
type ListPartsResult ¶
type ListPartsResult struct { Bucket string `xml:"Bucket"` Key string `xml:"Key"` UploadID string `xml:"UploadId"` Parts []*PartInfo `xml:"Part"` }
Multipart uploaded parts response
func (*ListPartsResult) MustMarshal ¶
func (r *ListPartsResult) MustMarshal(sgl *memsys.SGL)
type MptPart ¶
type MptPart struct { MD5 string // MD5 of the part (*) FQN string // FQN of the corresponding workfile Size int64 // part size in bytes (*) Num int64 // part number (*) }
NOTE: xattr stores only the (*) marked attributes
type ObjInfo ¶
type ObjInfo struct { Key string `xml:"Key"` LastModified string `xml:"LastModified"` ETag string `xml:"ETag"` Size int64 `xml:"Size"` Class string `xml:"StorageClass"` }
NOTE: do not rename structs that have `xml` tags. The names of those structs become a top level tag of resulting XML, and those tags S3-compatible clients require.
type PartInfo ¶
type PartInfo struct { ETag string `xml:"ETag"` PartNumber int64 `xml:"PartNumber"` Size int64 `xml:"Size,omitempty"` }
Multipart uploaded part
type UploadInfoResult ¶
type UploadInfoResult struct { Key string `xml:"Key"` UploadID string `xml:"UploadId"` Initiated time.Time `xml:"Initiated"` }
Active upload info
type VersioningConfiguration ¶
type VersioningConfiguration struct {
Status string `xml:"Status"`
}
Bucket versioning
func NewVersioningConfiguration ¶
func NewVersioningConfiguration(enabled bool) *VersioningConfiguration
func (*VersioningConfiguration) Enabled ¶
func (r *VersioningConfiguration) Enabled() bool
func (*VersioningConfiguration) MustMarshal ¶
func (r *VersioningConfiguration) MustMarshal(sgl *memsys.SGL)