-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoption.go
40 lines (32 loc) · 941 Bytes
/
option.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
package simplets
import . "github.com/aliyun/aliyun-tablestore-go-sdk/tablestore"
type Options struct {
storeZeroValue bool
columnFilter ColumnFilter
rowExistence RowExistenceExpectation
}
type EnsureTableOption struct {
// panic if table is not exist when call EnsureTable, if this option is not provided, EnsureTable will create table automatically
PanicIfTableNotExist bool
// option from tablestore sdk
TableOption *TableOption
ReservedThroughput *ReservedThroughput
StreamSpec *StreamSpecification
IndexMetas []*IndexMeta
}
type Option func(*Options)
func StoreZeroValue() Option {
return func(options *Options) {
options.storeZeroValue = true
}
}
func ColumnFilterOption(f ColumnFilter) Option {
return func(options *Options) {
options.columnFilter = f
}
}
func RowExistenceOption(r RowExistenceExpectation) Option {
return func(options *Options) {
options.rowExistence = r
}
}