common

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinStandardIaObjectSize int64 = 1 << 16 // 64KB
	MinGlacierObjectSize    int64 = 1 << 16 // 64KB
)

Variables

View Source
var (
	StatusIndexMap = map[RestoreStatus]string{
		ObjectNeedRestore: "READY",
		ObjectRestoring:   "RESTORING",
		ObjectHasRestored: "FINISH",
	}

	StatusStringMap = map[string]RestoreStatus{
		"READY":     ObjectNeedRestore,
		"RESTORING": ObjectRestoring,
		"FINISH":    ObjectHasRestored,
	}
)
View Source
var XXTEA_KEY = []byte("hehehehe")

Functions

func CorrectDeltaSize

func CorrectDeltaSize(storageClass StorageClass, deltaSize int64) (delta int64)

For billing now. FIXME later?

func Decrypt

func Decrypt(value string) (string, error)

func Encrypt

func Encrypt(value string) string

Types

type RestoreStatus

type RestoreStatus uint8
const (
	ObjectNeedRestore RestoreStatus = iota
	ObjectRestoring
	ObjectHasRestored
)

func MatchStatusIndex

func MatchStatusIndex(status string) (RestoreStatus, error)

func (RestoreStatus) ToString

func (s RestoreStatus) ToString() string

type StorageClass

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

func MatchStorageClassIndex(storageClass string) (StorageClass, error)

func (StorageClass) ToString

func (s StorageClass) ToString() string

type UnexpiredTriple

type UnexpiredTriple struct {
	StorageClass StorageClass
	Size         int64
	SurvivalTime int64 //Nano seconds
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL