Skip to content

Commit 37f663c

Browse files
committed
chore: refactor EventTriggerConfig structure and update golangci-lint configuration
- Reordered fields in EventTriggerConfig for clarity and consistency. - Restored Config field in EventTrigger struct. - Removed specific rules from golangci-lint configuration to streamline linting process.
1 parent 564ba5e commit 37f663c

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

.golangci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ linters:
8282
- common-false-positives
8383
- legacy
8484
- std-error-handling
85-
rules:
86-
- linters:
87-
- govet
88-
text: "fieldalignment: struct with 232 pointer bytes could be 224"
89-
- path: event_triggers\.go
90-
linters:
91-
- govet
92-
text: "fieldalignment:.*EventTriggerConfig"
9385
formatters:
9486
enable:
9587
- gofmt

appservices/event_triggers.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ type EventTrigger struct {
176176
EventProcessors map[string]interface{} `json:"event_processors,omitempty"`
177177
Disabled *bool `json:"disabled,omitempty"`
178178
LastModified *int64 `json:"last_modified,omitempty"`
179-
Config EventTriggerConfig `json:"config,omitempty"`
180179
ID string `json:"_id,omitempty"`
181180
Name string `json:"name,omitempty"`
182181
Type string `json:"type,omitempty"`
183182
FunctionID string `json:"function_id,omitempty"`
184183
FunctionName string `json:"function_name,omitempty"`
184+
Config EventTriggerConfig `json:"config,omitempty"`
185185
}
186186

187187
// EventTriggerRequest Represents a request of create a trigger.
@@ -196,21 +196,21 @@ type EventTriggerRequest struct {
196196

197197
// EventTriggerConfig Represents a request of a trigger config.
198198
type EventTriggerConfig struct {
199-
OperationTypes []string `json:"operation_types,omitempty"`
200-
Providers []string `json:"providers,omitempty"`
199+
Match interface{} `json:"match,omitempty"`
200+
Project interface{} `json:"project,omitempty"`
201+
Unordered *bool `json:"unordered,omitempty"`
201202
FullDocument *bool `json:"full_document,omitempty"`
202203
FullDocumentBeforeChange *bool `json:"full_document_before_change,omitempty"`
203-
Unordered *bool `json:"unordered,omitempty"`
204204
TolerateResumeErrors *bool `json:"tolerate_resume_errors,omitempty"`
205205
SkipCatchupEvents *bool `json:"skip_catchup_events,omitempty"`
206206
MaximumThroughput *bool `json:"maximum_throughput,omitempty"`
207-
Match interface{} `json:"match,omitempty"`
208-
Project interface{} `json:"project,omitempty"`
207+
Collection string `json:"collection,omitempty"`
209208
OperationType string `json:"operation_type,omitempty"`
210209
Database string `json:"database,omitempty"`
211-
Collection string `json:"collection,omitempty"`
212210
ServiceID string `json:"service_id,omitempty"`
213211
Schedule string `json:"schedule,omitempty"`
214212
ScheduleType string `json:"schedule_type,omitempty"`
215213
ClusterName string `json:"clusterName,omitempty"`
214+
Providers []string `json:"providers,omitempty"`
215+
OperationTypes []string `json:"operation_types,omitempty"`
216216
}

0 commit comments

Comments
 (0)