-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.go
80 lines (59 loc) · 1.85 KB
/
options.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
package s3
import (
"go.unistack.org/micro/v3/store"
)
type endpointKey struct{}
// Endpoint sets the endpoint option
func Endpoint(ep string) store.Option {
return store.SetOption(endpointKey{}, ep)
}
type regionKey struct{}
// Region sets the region option
func Region(reg string) store.Option {
return store.SetOption(regionKey{}, reg)
}
type accessKey struct{}
// AccessKey sets the AccessKey option
func AccessKey(akey string) store.Option {
return store.SetOption(accessKey{}, akey)
}
type secretKey struct{}
// SecretKey sets the SecretKey option
func SecretKey(skey string) store.Option {
return store.SetOption(secretKey{}, skey)
}
type bucketKey struct{}
// ReadBucket sets the bucket name option
func ReadBucket(bucket string) store.ReadOption {
return store.SetReadOption(bucketKey{}, bucket)
}
// WriteBucket sets the bucket name option
func WriteBucket(bucket string) store.WriteOption {
return store.SetWriteOption(bucketKey{}, bucket)
}
type writeSizeKey struct{}
// WriteSize key values size hint
func WriteSize(size int64) store.WriteOption {
return store.SetWriteOption(writeSizeKey{}, size)
}
// DeleteBucket sets the bucket name option
func DeleteBucket(bucket string) store.DeleteOption {
return store.SetDeleteOption(bucketKey{}, bucket)
}
type contentTypeKey struct{}
func ContentType(ct string) store.WriteOption {
return store.SetWriteOption(contentTypeKey{}, ct)
}
// ListBucket sets the bucket name option
func ListBucket(bucket string) store.ListOption {
return store.SetListOption(bucketKey{}, bucket)
}
type listRecursiveKey struct{}
// ListRecursive sets the bucket name option
func ListRecursive(b bool) store.ListOption {
return store.SetListOption(listRecursiveKey{}, b)
}
// ExistsBucket sets the bucket name option
func ExistsBucket(bucket string) store.ExistsOption {
return store.SetExistsOption(bucketKey{}, bucket)
}