forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
batch_options.go
90 lines (69 loc) · 2.48 KB
/
batch_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
81
82
83
84
85
86
87
88
89
90
package ravendb
import "time"
// BatchOptions describes options for batch operations
type BatchOptions struct {
waitForReplicas bool
numberOfReplicasToWaitFor int
waitForReplicasTimeout time.Duration
majority bool
throwOnTimeoutInWaitForReplicas bool
waitForIndexes bool
waitForIndexesTimeout time.Duration
throwOnTimeoutInWaitForIndexes bool
waitForSpecificIndexes []string
}
// TODO: remove getters/setters
func (o *BatchOptions) isWaitForReplicas() bool {
return o.waitForReplicas
}
func (o *BatchOptions) setWaitForReplicas(waitForReplicas bool) {
o.waitForReplicas = waitForReplicas
}
func (o *BatchOptions) getNumberOfReplicasToWaitFor() int {
return o.numberOfReplicasToWaitFor
}
func (o *BatchOptions) setNumberOfReplicasToWaitFor(numberOfReplicasToWaitFor int) {
o.numberOfReplicasToWaitFor = numberOfReplicasToWaitFor
}
func (o *BatchOptions) getWaitForReplicasTimeout() time.Duration {
return o.waitForReplicasTimeout
}
func (o *BatchOptions) setWaitForReplicasTimeout(waitForReplicasTimeout time.Duration) {
o.waitForReplicasTimeout = waitForReplicasTimeout
}
func (o *BatchOptions) isMajority() bool {
return o.majority
}
func (o *BatchOptions) setMajority(majority bool) {
o.majority = majority
}
func (o *BatchOptions) isThrowOnTimeoutInWaitForReplicas() bool {
return o.throwOnTimeoutInWaitForReplicas
}
func (o *BatchOptions) setThrowOnTimeoutInWaitForReplicas(throwOnTimeoutInWaitForReplicas bool) {
o.throwOnTimeoutInWaitForReplicas = throwOnTimeoutInWaitForReplicas
}
func (o *BatchOptions) isWaitForIndexes() bool {
return o.waitForIndexes
}
func (o *BatchOptions) setWaitForIndexes(waitForIndexes bool) {
o.waitForIndexes = waitForIndexes
}
func (o *BatchOptions) getWaitForIndexesTimeout() time.Duration {
return o.waitForIndexesTimeout
}
func (o *BatchOptions) setWaitForIndexesTimeout(waitForIndexesTimeout time.Duration) {
o.waitForIndexesTimeout = waitForIndexesTimeout
}
func (o *BatchOptions) isThrowOnTimeoutInWaitForIndexes() bool {
return o.throwOnTimeoutInWaitForIndexes
}
func (o *BatchOptions) setThrowOnTimeoutInWaitForIndexes(throwOnTimeoutInWaitForIndexes bool) {
o.throwOnTimeoutInWaitForIndexes = throwOnTimeoutInWaitForIndexes
}
func (o *BatchOptions) getWaitForSpecificIndexes() []string {
return o.waitForSpecificIndexes
}
func (o *BatchOptions) setWaitForSpecificIndexes(waitForSpecificIndexes []string) {
o.waitForSpecificIndexes = waitForSpecificIndexes
}