Documentation ¶
Index ¶
- Constants
- func CheckECPieceKey(keys []string) bool
- func CheckSegmentPieceKey(keys []string) bool
- func ComputeApproximatePieceSize(object *storagetypes.ObjectInfo, maxSegmentPieceSize uint64, ...) (int, error)
- func ComputeSegmentCount(size uint64, spiltSize uint64) uint32
- func DecodeECPieceKey(pieceKey string) (uint64, uint32, uint32, error)
- func DecodeSegmentPieceKey(pieceKey string) (uint64, uint32, error)
- func EncodeECPieceKey(objectID uint64, segmentIndex, ecIndex uint32) string
- func EncodeSegmentPieceKey(objectID uint64, segmentIndex uint32) string
- func GenerateObjectECKeyList(objectID, objectSize, segmentSize, redundancyIndex uint64) []string
- func GenerateObjectSegmentKeyList(objectID, objectSize, segmentSize uint64) []string
Constants ¶
const ( // S3Store defines storage type for s3 S3Store = "s3" // MinioStore defines storage type for minio MinioStore = "minio" // DiskFileStore defines storage type for file DiskFileStore = "file" // MemoryStore defines storage type for memory MemoryStore = "memory" )
define storage type constants
const ( // AKSKIAMType defines IAM type config which uses access key and secret key to access aws s3 AKSKIAMType = "AKSK" // SAIAMType defines IAM type config which uses service account to access aws s3 SAIAMType = "SA" // AWSRoleARN defines env variable for aws role arn AWSRoleARN = "AWS_ROLE_ARN" // AWSWebIdentityTokenFile defines env variable for aws identity token file AWSWebIdentityTokenFile = "AWS_WEB_IDENTITY_TOKEN_FILE" // BucketURL defines env variable name for bucket url BucketURL = "BUCKET_URL" // AWSAccessKey defines env variable name for aws access key AWSAccessKey = "AWS_ACCESS_KEY" // AWSSecretKey defines env variable name for aws secret key AWSSecretKey = "AWS_SECRET_KEY" // AWSSessionToken defines env variable name for aws session token AWSSessionToken = "AWS_SESSION_TOKEN" // MinioRegion defines env variable name for minio region MinioRegion = "MINIO_REGION" // MinioAccessKey defines env variable name for minio access key MinioAccessKey = "MINIO_ACCESS_KEY" // MinioSecretKey defines env variable name for minio secret key MinioSecretKey = "MINIO_SECRET_KEY" // MinioSessionToken defines env variable name for minio session token MinioSessionToken = "MINIO_SESSION_TOKEN" )
piece store storage config and environment constants
const ( // BufPoolSize define buffer pool size BufPoolSize = 32 << 10 // ChecksumAlgo define validation algorithm name ChecksumAlgo = "Crc32c" )
define piece store constants.
Variables ¶
This section is empty.
Functions ¶
func CheckECPieceKey ¶
CheckECPieceKey checks EC piece key is correct
func CheckSegmentPieceKey ¶
CheckSegmentPieceKey checks ec piece key is correct
func ComputeApproximatePieceSize ¶ added in v0.1.1
func ComputeApproximatePieceSize(object *storagetypes.ObjectInfo, maxSegmentPieceSize uint64, dataChunkNum uint32, pieceType model.PieceType, idx uint32) (int, error)
ComputeApproximatePieceSize return the size of piece data
func ComputeSegmentCount ¶
ComputeSegmentCount return the segments count by payload size.
func DecodeECPieceKey ¶
DecodeECPieceKey decodes ec piece store key Valid EC piece key: objectID_s0_p0
func DecodeSegmentPieceKey ¶
DecodeSegmentPieceKey decodes segment piece store key Valid segment piece key: objectID_s0
func EncodeECPieceKey ¶
EncodeECPieceKey encodes ec piece store key
func EncodeSegmentPieceKey ¶
EncodeSegmentPieceKey encodes segment piece store key
func GenerateObjectECKeyList ¶ added in v0.2.0
GenerateObjectECKeyList generate object's ec piece key list.
func GenerateObjectSegmentKeyList ¶ added in v0.2.0
GenerateObjectSegmentKeyList generate object's segment piece key list.
Types ¶
This section is empty.