/
persistent_options.go
171 lines (134 loc) · 3.84 KB
/
persistent_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
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 esdb
import "time"
type PersistentStreamSubscriptionOptions struct {
Settings *SubscriptionSettings
StartFrom StreamPosition
Authenticated *Credentials
Deadline *time.Duration
}
func (o *PersistentStreamSubscriptionOptions) kind() operationKind {
return RegularOperation
}
func (o *PersistentStreamSubscriptionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *PersistentStreamSubscriptionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *PersistentStreamSubscriptionOptions) setDefaults() {
if o.StartFrom == nil {
o.StartFrom = End{}
}
}
type PersistentAllSubscriptionOptions struct {
Settings *SubscriptionSettings
StartFrom AllPosition
MaxSearchWindow int
Filter *SubscriptionFilter
Authenticated *Credentials
Deadline *time.Duration
}
func (o *PersistentAllSubscriptionOptions) kind() operationKind {
return RegularOperation
}
func (o *PersistentAllSubscriptionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *PersistentAllSubscriptionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *PersistentAllSubscriptionOptions) setDefaults() {
if o.StartFrom == nil {
o.StartFrom = End{}
}
if o.Filter != nil {
if o.MaxSearchWindow == 0 {
o.MaxSearchWindow = 32
}
}
}
type SubscribeToPersistentSubscriptionOptions struct {
BufferSize uint32
Authenticated *Credentials
Deadline *time.Duration
}
func (o *SubscribeToPersistentSubscriptionOptions) kind() operationKind {
return StreamingOperation
}
func (o *SubscribeToPersistentSubscriptionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *SubscribeToPersistentSubscriptionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *SubscribeToPersistentSubscriptionOptions) setDefaults() {
if o.BufferSize == 0 {
o.BufferSize = 10
}
}
type DeletePersistentSubscriptionOptions struct {
Authenticated *Credentials
Deadline *time.Duration
}
func (d DeletePersistentSubscriptionOptions) kind() operationKind {
return RegularOperation
}
func (d DeletePersistentSubscriptionOptions) credentials() *Credentials {
return d.Authenticated
}
func (d DeletePersistentSubscriptionOptions) deadline() *time.Duration {
return d.Deadline
}
type ReplayParkedMessagesOptions struct {
Authenticated *Credentials
StopAt int
Deadline *time.Duration
}
func (r ReplayParkedMessagesOptions) kind() operationKind {
return RegularOperation
}
func (r ReplayParkedMessagesOptions) credentials() *Credentials {
return r.Authenticated
}
func (r ReplayParkedMessagesOptions) deadline() *time.Duration {
return r.Deadline
}
type ListPersistentSubscriptionsOptions struct {
Authenticated *Credentials
Deadline *time.Duration
}
func (l ListPersistentSubscriptionsOptions) kind() operationKind {
return RegularOperation
}
func (l ListPersistentSubscriptionsOptions) credentials() *Credentials {
return l.Authenticated
}
func (l ListPersistentSubscriptionsOptions) deadline() *time.Duration {
return l.Deadline
}
type GetPersistentSubscriptionOptions struct {
Authenticated *Credentials
Deadline *time.Duration
}
func (g GetPersistentSubscriptionOptions) kind() operationKind {
return RegularOperation
}
func (g GetPersistentSubscriptionOptions) credentials() *Credentials {
return g.Authenticated
}
func (g GetPersistentSubscriptionOptions) deadline() *time.Duration {
return g.Deadline
}
type RestartPersistentSubscriptionSubsystemOptions struct {
Authenticated *Credentials
Deadline *time.Duration
}
func (g RestartPersistentSubscriptionSubsystemOptions) kind() operationKind {
return RegularOperation
}
func (g RestartPersistentSubscriptionSubsystemOptions) credentials() *Credentials {
return g.Authenticated
}
func (g RestartPersistentSubscriptionSubsystemOptions) deadline() *time.Duration {
return g.Deadline
}