Documentation ¶
Index ¶
- Constants
- Variables
- func GetMultipartUploadIdForTidb(uploadtime uint64) string
- type Bucket
- type Cluster
- type CompleteMultipartUpload
- type CompletePart
- type CompletedParts
- type DB
- type GarbageCollection
- type LifeCycle
- type ListObjectsInfo
- type Multipart
- type MultipartMetadata
- type ObjMap
- type Object
- func (o *Object) GetAddUsageSql() (string, []interface{})
- func (o *Object) GetAppendSql() (string, []interface{})
- func (o *Object) GetCreateSql() (string, []interface{})
- func (o *Object) GetSubUsageSql() (string, []interface{})
- func (o *Object) GetUpdateAclSql() (string, []interface{})
- func (o *Object) GetUpdateAttrsSql() (string, []interface{})
- func (o *Object) GetUpdateNameSql(sourceObject string) (string, []interface{})
- func (o *Object) GetUpdateObjectPartNameSql(sourceObject string) (string, []interface{})
- func (o *Object) GetVersionId() string
- func (o *Object) GetVersionNumber() (uint64, error)
- func (o *Object) ObjectTypeToString() string
- func (o *Object) String() (s string)
- type ObjectType
- type Part
- type PartTooSmall
- type ScanLifeCycleResult
- type SimpleIndex
- type StorageClass
- type VersionedListObjectsInfo
Constants ¶
View Source
const ( VersionEnabled = "Enabled" VersionDisabled = "Disabled" VersionSuspended = "Suspended" )
View Source
const ( CREATE_TIME_LAYOUT = "2006-01-02T15:04:05.000Z" TIME_LAYOUT_TIDB = "2006-01-02 15:04:05" INITIALIZATION_VECTOR_LENGTH = 16 // 12 bytes is best performance for GCM, but for CTR ObjectNameEnding = ":" ObjectNameSeparator = "\n" ObjectNameSmallestStr = " " ResponseNumberOfRows = 1024 )
Variables ¶
View Source
var ( XXTEA_KEY = []byte("hehehehe") SSE_S3_MASTER_KEY = []byte("hehehehehehehehehehehehehehehehe") // 32 bytes to select AES-256 )
View Source
var ( StorageClassIndexMap = map[StorageClass]string{ ObjectStorageClassStandard: "STANDARD", ObjectStorageClassStandardIa: "STANDARD_IA", ObjectStorageClassIntelligentTiering: "INTELLIGENT_TIERING", ObjectStorageClassOnezoneIa: "ONEZONE_IA", ObjectStorageClassGlacier: "GLACIER", ObjectStorageClassDeepArchive: "DEEP_ARCHIVE", ObjectStorageClassReducedRedundancy: "RRS", } StorageClassStringMap = map[string]StorageClass{ "STANDARD": ObjectStorageClassStandard, "STANDARD_IA": ObjectStorageClassStandardIa, "INTELLIGENT_TIERING": ObjectStorageClassIntelligentTiering, "ONEZONE_IA": ObjectStorageClassOnezoneIa, "GLACIER": ObjectStorageClassGlacier, "DEEP_ARCHIVE": ObjectStorageClassDeepArchive, "RRS": ObjectStorageClassReducedRedundancy, } )
Functions ¶
func GetMultipartUploadIdForTidb ¶ added in v0.6.1
Types ¶
type Bucket ¶
type Bucket struct { Name string // Date and time when the bucket was created, // should be serialized into format "2006-01-02T15:04:05.000Z" CreateTime time.Time OwnerId string CORS datatype.Cors ACL datatype.Acl Lifecycle datatype.Lifecycle Policy policy.Policy Website datatype.WebsiteConfiguration Versioning string // actually enum: Disabled/Enabled/Suspended Usage int64 }
func (Bucket) GetCreateSql ¶
func (Bucket) GetUpdateSql ¶
Tidb related function
type CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
Parts []CompletePart `xml:"Part"`
}
completeMultipartUpload - represents input fields for completing multipart upload.
type CompletePart ¶
type CompletePart struct { // Part number identifying the part. This is a positive integer between 1 and // 10,000 PartNumber int // Entity tag returned when the part was uploaded. ETag string }
completePart - completed part container.
type CompletedParts ¶
type CompletedParts []CompletePart
completedParts - is a collection satisfying sort.Interface.
func (CompletedParts) Len ¶
func (a CompletedParts) Len() int
func (CompletedParts) Less ¶
func (a CompletedParts) Less(i, j int) bool
func (CompletedParts) Swap ¶
func (a CompletedParts) Swap(i, j int)
type DB ¶ added in v0.6.1
type DB interface { Exec(string, ...interface{}) (sql.Result, error) Query(string, ...interface{}) (*sql.Rows, error) QueryRow(string, ...interface{}) *sql.Row }
This should work with database/sql.DB and database/sql.Tx. Stolen from xo/xo
type GarbageCollection ¶
type ListObjectsInfo ¶
type ListObjectsInfo struct { // Indicates whether the returned list objects response is truncated. A // value of true indicates that the list was truncated. The list can be truncated // if the number of objects exceeds the limit allowed or specified // by max keys. IsTruncated bool // When response is truncated (the IsTruncated element value in the response // is true), you can use the key name in this field as marker in the subsequent // request to get next set of objects. // // NOTE: This element is returned only if you have delimiter request parameter // specified. NextMarker string // List of objects info for this request. Objects []datatype.Object // List of prefixes for this request. Prefixes []string }
ListObjectsInfo - container for list objects.
type Multipart ¶
type Multipart struct { BucketName string ObjectName string InitialTime time.Time UploadId string // upload id cache Metadata MultipartMetadata Parts map[int]*Part }
func (*Multipart) GetUploadId ¶ added in v0.6.1
type MultipartMetadata ¶
type Object ¶
type Object struct { Rowkey []byte // Rowkey cache Name string BucketName string Location string // which Ceph cluster this object locates Pool string // which Ceph pool this object locates OwnerId string Size int64 // file size ObjectId string // object name in Ceph LastModifiedTime time.Time // in format "2006-01-02T15:04:05.000Z" Etag string ContentType string CustomAttributes map[string]string Parts map[int]*Part PartsIndex *SimpleIndex ACL datatype.Acl NullVersion bool // if this entry has `null` version DeleteMarker bool // if this entry is a delete marker VersionId string // version cache // type of Server Side Encryption, could be "SSE-KMS", "SSE-S3", "SSE-C"(custom), or ""(none), // KMS is not implemented yet SseType string // encryption key for SSE-S3, the key itself is encrypted with SSE_S3_MASTER_KEY, // in AES256-GCM EncryptionKey []byte InitializationVector []byte // ObjectType include `Normal`, `Appendable`, 'Multipart' Type ObjectType StorageClass StorageClass }
func (*Object) GetAddUsageSql ¶ added in v0.6.1
func (*Object) GetAppendSql ¶ added in v0.6.1
func (*Object) GetCreateSql ¶
func (*Object) GetSubUsageSql ¶ added in v0.6.1
func (*Object) GetUpdateAclSql ¶
func (*Object) GetUpdateAttrsSql ¶
func (*Object) GetUpdateNameSql ¶
func (*Object) GetUpdateObjectPartNameSql ¶
func (*Object) GetVersionId ¶ added in v0.6.1
func (*Object) GetVersionNumber ¶ added in v0.6.1
func (*Object) ObjectTypeToString ¶
type ObjectType ¶
type ObjectType int
const ( ObjectTypeNormal ObjectType = 0 ObjectTypeAppendable ObjectType = 1 ObjectTypeMultipart ObjectType = 2 )
type Part ¶
type Part struct { PartNumber int Size int64 ObjectId string // offset of this part in whole object, calculated when moving parts from // `multiparts` table to `objects` table Offset int64 Etag string LastModified string // time string of format "2006-01-02T15:04:05.000Z" InitializationVector []byte }
func (*Part) GetCreateGcSql ¶
func (*Part) GetCreateSql ¶
type PartTooSmall ¶
PartTooSmall - error if part size is less than 5MB.
func (PartTooSmall) Error ¶
func (e PartTooSmall) Error() string
type ScanLifeCycleResult ¶
type SimpleIndex ¶
type SimpleIndex struct {
Index []int64
}
func (*SimpleIndex) SearchLowerBound ¶
func (array *SimpleIndex) SearchLowerBound(key int64) int
func (*SimpleIndex) SearchUpperBound ¶
func (array *SimpleIndex) SearchUpperBound(key int64) int
type StorageClass ¶ added in v0.6.1
type StorageClass uint8
const ( // ObjectStorageClassStandard is a ObjectStorageClass enum value ObjectStorageClassStandard StorageClass = iota // ObjectStorageClassReducedRedundancy is a ObjectStorageClass enum value ObjectStorageClassReducedRedundancy // ObjectStorageClassGlacier is a ObjectStorageClass enum value ObjectStorageClassGlacier // ObjectStorageClassStandardIa is a ObjectStorageClass enum value ObjectStorageClassStandardIa // ObjectStorageClassOnezoneIa is a ObjectStorageClass enum value ObjectStorageClassOnezoneIa // ObjectStorageClassIntelligentTiering is a ObjectStorageClass enum value ObjectStorageClassIntelligentTiering // ObjectStorageClassIntelligentTiering is a ObjectStorageClass enum value ObjectStorageClassDeepArchive )
Reference:https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/dev/storage-class-intro.html
func MatchStorageClassIndex ¶ added in v0.6.1
func MatchStorageClassIndex(storageClass string) (StorageClass, error)
func (StorageClass) ToString ¶ added in v0.6.1
func (s StorageClass) ToString() string
Click to show internal directories.
Click to hide internal directories.