-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeout.go
47 lines (38 loc) · 946 Bytes
/
timeout.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
package s3util
import "time"
type S3Timeout struct {
Upload time.Duration
HeadObject time.Duration
CreateBucket time.Duration
BucketExist time.Duration
CountObject time.Duration
GetUrl time.Duration
}
func NewDefaultTimeout() *S3Timeout {
return &S3Timeout{
Upload: time.Minute,
HeadObject: 3 * time.Second,
CreateBucket: 3 * time.Second,
BucketExist: 3 * time.Second,
CountObject: 10 * time.Second,
GetUrl: time.Second,
}
}
func (t *S3Timeout) GetUploadTime() time.Duration {
return t.Upload
}
func (t *S3Timeout) GetHeadObjTime() time.Duration {
return t.HeadObject
}
func (t *S3Timeout) GetCreateBucketTime() time.Duration {
return t.CreateBucket
}
func (t *S3Timeout) GetBucketExistTime() time.Duration {
return t.BucketExist
}
func (t *S3Timeout) GetCountObjTime() time.Duration {
return t.CountObject
}
func (t *S3Timeout) GetGetURLTime() time.Duration {
return t.GetUrl
}