This repository was archived by the owner on Jan 4, 2025. It is now read-only.
forked from kurrent-io/EventStore-Client-Go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojection_options.go
More file actions
219 lines (176 loc) · 5.53 KB
/
projection_options.go
File metadata and controls
219 lines (176 loc) · 5.53 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
package esdb
import "time"
type CreateProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
// If the server should track all the stream the projection ever emit an event into.
TrackEmittedStreams bool
// If the projection should be able to write events.
Emit bool
}
func (o *CreateProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *CreateProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *CreateProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *CreateProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *CreateProjectionOptions) setDefaults() {
}
type UpdateProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
// If the projection should be able to write events.
Emit *bool
}
func (o *UpdateProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *UpdateProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *UpdateProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *UpdateProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *UpdateProjectionOptions) setDefaults() {
}
type DeleteProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
// If the server should delete all the streams the projection created.
DeleteEmittedStreams bool
// If the server should delete the stream storing the projection's state.
DeleteStateStream bool
// if the server should delete the stream where all the projection's checkpoints are stored.
DeleteCheckpointStream bool
}
func (o *DeleteProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *DeleteProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *DeleteProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *DeleteProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *DeleteProjectionOptions) setDefaults() {
}
type GetStateProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
// Partition of the projection we are getting the state from. Leave empty
// if the projection doesn't have any partition.
Partition string
}
func (o *GetStateProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *GetStateProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *GetStateProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *GetStateProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *GetStateProjectionOptions) setDefaults() {
}
type GetResultProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
// Partition of the projection we are getting the result from. Leave empty
// if the projection doesn't have any partition.
Partition string
}
func (o *GetResultProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *GetResultProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *GetResultProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *GetResultProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *GetResultProjectionOptions) setDefaults() {
}
type ResetProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
// If the server writes a checkpoint upon resetting.
WriteCheckpoint bool
}
func (o *ResetProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *ResetProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *ResetProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *ResetProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *ResetProjectionOptions) setDefaults() {
}
type GenericProjectionOptions struct {
// Asks for authenticated request.
Authenticated *Credentials
// A length of time to use for gRPC deadlines.
Deadline *time.Duration
// Requires the request to be performed by the leader of the cluster.
RequiresLeader bool
}
func (o *GenericProjectionOptions) kind() operationKind {
return regularOperation
}
func (o *GenericProjectionOptions) credentials() *Credentials {
return o.Authenticated
}
func (o *GenericProjectionOptions) deadline() *time.Duration {
return o.Deadline
}
func (o *GenericProjectionOptions) requiresLeader() bool {
return o.RequiresLeader
}
func (o *GenericProjectionOptions) setDefaults() {
}