-
Notifications
You must be signed in to change notification settings - Fork 99
/
const.go
171 lines (162 loc) · 6.54 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package lib
import (
"os"
oss "github.com/aliyun/aliyun-oss-go-sdk/oss"
)
// all supported options of ossutil
const (
OptionConfigFile string = "configFile"
OptionEndpoint = "endpoint"
OptionAccessKeyID = "accessKeyID"
OptionAccessKeySecret = "accessKeySecret"
OptionSTSToken = "stsToken"
OptionACL = "acl"
OptionShortFormat = "shortFormat"
OptionLimitedNum = "limitedNum"
OptionMarker = "marker"
OptionUploadIDMarker = "uploadIDMarker"
OptionDirectory = "directory"
OptionMultipart = "multipart"
OptionAllType = "allType"
OptionRecursion = "recursive"
OptionBucket = "bucket"
OptionStorageClass = "storageClass"
OptionForce = "force"
OptionUpdate = "update"
OptionDelete = "delete"
OptionContinue = "continue"
OptionOutputDir = "outputDir"
OptionBigFileThreshold = "bigfileThreshold"
OptionCheckpointDir = "checkpointDir"
OptionSnapshotPath = "snapshotPath"
OptionRetryTimes = "retryTimes"
OptionRoutines = "routines"
OptionParallel = "parallel"
OptionRange = "range"
OptionEncodingType = "encodingType"
OptionLanguage = "language"
OptionHashType = "hashType"
OptionVersion = "version"
OptionPartSize = "partSize"
OptionDisableCRC64 = "disableCRC64"
OptionTimeout = "timeout"
OptionInclude = "include"
OptionExclude = "exclude"
OptionMeta = "meta"
OptionRequestPayer = "payer"
OptionLogLevel = "loglevel"
OptionMaxUpSpeed = "maxupspeed"
OptionUpload = "upload"
OptionDownload = "download"
OptionUrl = "url"
OptionBucketName = "bucketname"
OptionObject = "object"
OptionAddr = "addr"
OptionUpMode = "upmode"
OptionDisableEmptyReferer = "disableEmptyReferer"
OptionMethod = "method"
OptionOrigin = "origin"
OptionPartitionDownload = "partitionDownload"
OptionSSEAlgorithm = "SSEAlgorithm"
OptionKMSMasterKeyID = "KMSMasterKeyID"
)
// the elements show in stat object
const (
StatName string = "Name"
StatLocation = "Location"
StatCreationDate = "CreationDate"
StatExtranetEndpoint = "ExtranetEndpoint"
StatIntranetEndpoint = "IntranetEndpoint"
StatACL = "ACL"
StatOwner = "Owner"
StatLastModified = "Last-Modified"
StatContentMD5 = "Content-Md5"
StatCRC64 = "X-Oss-Hash-Crc64ecma"
StatStorageClass = "StorageClass"
StatSSEAlgorithm = "SSEAlgorithm"
StatKMSMasterKeyID = "KMSMasterKeyID"
)
// the elements show in hash file
const (
HashCRC64 = "CRC64-ECMA"
HashMD5 = "MD5"
HashContentMD5 = "Content-MD5"
)
const (
updateEndpoint string = "oss-cn-hangzhou.aliyuncs.com"
updateBucket = "ossutil-version-update"
updateVersionObject = "ossutilversion"
updateBinaryLinux32 = "ossutil32"
updateBinaryLinux64 = "ossutil64"
updateBinaryWindow32 = "ossutil32.exe"
updateBinaryWindow64 = "ossutil64.exe"
updateBinaryMac32 = "ossutilmac32"
updateBinaryMac64 = "ossutilmac64"
updateTmpVersionFile = ".ossutil_tmp_vsersion"
)
// global public variable
const (
Package string = "ossutil"
ChannelBuf int = 1000
Version string = "v1.6.1"
DefaultEndpoint string = "oss.aliyuncs.com"
ChineseLanguage = "CH"
EnglishLanguage = "EN"
Scheme string = "oss"
DefaultConfigFile = "~" + string(os.PathSeparator) + ".ossutilconfig"
MaxUint uint = ^uint(0)
MaxInt int = int(MaxUint >> 1)
MaxUint64 uint64 = ^uint64(0)
MaxInt64 int64 = int64(MaxUint64 >> 1)
ReportPrefix = "ossutil_report_"
ReportSuffix = ".report"
DefaultOutputDir = "ossutil_output"
CheckpointDir = ".ossutil_checkpoint"
CheckpointSep = "---"
SnapshotConnector = "==>"
SnapshotSep = "#"
MaxPartNum = 10000
MaxIdealPartNum = MaxPartNum / 10
MinIdealPartNum = MaxPartNum / 500
MaxIdealPartSize = 524288000
MinIdealPartSize = 1048576
DefaultBigFileThreshold int64 = 104857600
MaxBigFileThreshold int64 = MaxInt64
MinBigFileThreshold int64 = 0
DefaultPartSize int64 = -1
MaxPartSize int64 = MaxInt64
MinPartSize int64 = 1
DefaultLimitedNum = -1
MinLimitedNum = 0
RetryTimes int = 10
MaxRetryTimes int64 = 500
MinRetryTimes int64 = 1
Routines int = 3
MaxRoutines int64 = 10000
MinRoutines int64 = 1
MaxParallel int64 = 10000
MinParallel int64 = 1
DefaultHashType string = "crc64"
MD5HashType string = "md5"
LogFilePrefix = "ossutil_log_"
URLEncodingType = "url"
StorageStandard = string(oss.StorageStandard)
StorageIA = string(oss.StorageIA)
StorageArchive = string(oss.StorageArchive)
DefaultStorageClass = StorageStandard
DefaultMethod = string(oss.HTTPGet)
DefaultTimeout = 60
MinTimeout = 0
MaxTimeout = MaxInt64
DefaultNonePattern = ""
IncludePrompt = "--include"
ExcludePrompt = "--exclude"
MaxAppendObjectSize int64 = 5368709120
)
const (
objectType = 0x00000001
multipartType = 0x00000010
allType = objectType | multipartType // marker for objects
bucketType = 0x10000000
)
var DefaultLanguage = getOsLang()