@@ -112,6 +112,8 @@ type GeneratePluginConfig interface {
112
112
//
113
113
// This is not empty only when the plugin is remote.
114
114
Revision () int
115
+ // ExcludeOptions returns the options to exclude.
116
+ ExcludeOptions () []string
115
117
116
118
isGeneratePluginConfig ()
117
119
}
@@ -123,6 +125,7 @@ func NewRemoteGeneratePluginConfig(
123
125
opt []string ,
124
126
includeImports bool ,
125
127
includeWKT bool ,
128
+ excludeOptions []string ,
126
129
revision int ,
127
130
) (GeneratePluginConfig , error ) {
128
131
return newRemoteGeneratePluginConfig (
@@ -131,6 +134,7 @@ func NewRemoteGeneratePluginConfig(
131
134
opt ,
132
135
includeImports ,
133
136
includeWKT ,
137
+ excludeOptions ,
134
138
revision ,
135
139
)
136
140
}
@@ -142,6 +146,7 @@ func NewLocalOrProtocBuiltinGeneratePluginConfig(
142
146
opt []string ,
143
147
includeImports bool ,
144
148
includeWKT bool ,
149
+ excludeOptions []string ,
145
150
strategy * GenerateStrategy ,
146
151
) (GeneratePluginConfig , error ) {
147
152
return newLocalOrProtocBuiltinGeneratePluginConfig (
@@ -150,6 +155,7 @@ func NewLocalOrProtocBuiltinGeneratePluginConfig(
150
155
opt ,
151
156
includeImports ,
152
157
includeWKT ,
158
+ excludeOptions ,
153
159
strategy ,
154
160
)
155
161
}
@@ -161,6 +167,7 @@ func NewLocalGeneratePluginConfig(
161
167
opt []string ,
162
168
includeImports bool ,
163
169
includeWKT bool ,
170
+ excludeOptions []string ,
164
171
strategy * GenerateStrategy ,
165
172
path []string ,
166
173
) (GeneratePluginConfig , error ) {
@@ -170,6 +177,7 @@ func NewLocalGeneratePluginConfig(
170
177
opt ,
171
178
includeImports ,
172
179
includeWKT ,
180
+ excludeOptions ,
173
181
strategy ,
174
182
path ,
175
183
)
@@ -183,6 +191,7 @@ func NewProtocBuiltinGeneratePluginConfig(
183
191
opt []string ,
184
192
includeImports bool ,
185
193
includeWKT bool ,
194
+ excludeOptions []string ,
186
195
strategy * GenerateStrategy ,
187
196
protocPath []string ,
188
197
) (GeneratePluginConfig , error ) {
@@ -192,6 +201,7 @@ func NewProtocBuiltinGeneratePluginConfig(
192
201
opt ,
193
202
includeImports ,
194
203
includeWKT ,
204
+ excludeOptions ,
195
205
strategy ,
196
206
protocPath ,
197
207
)
@@ -203,6 +213,7 @@ func NewGeneratePluginConfigWithIncludeImportsAndWKT(
203
213
config GeneratePluginConfig ,
204
214
includeImports bool ,
205
215
includeWKT bool ,
216
+ excludeOptions []string ,
206
217
) (GeneratePluginConfig , error ) {
207
218
originalConfig , ok := config .(* generatePluginConfig )
208
219
if ! ok {
@@ -215,6 +226,9 @@ func NewGeneratePluginConfigWithIncludeImportsAndWKT(
215
226
if includeWKT {
216
227
generatePluginConfig .includeWKT = true
217
228
}
229
+ if len (excludeOptions ) > 0 {
230
+ generatePluginConfig .excludeOptions = excludeOptions
231
+ }
218
232
return & generatePluginConfig , nil
219
233
}
220
234
@@ -227,6 +241,7 @@ type generatePluginConfig struct {
227
241
opts []string
228
242
includeImports bool
229
243
includeWKT bool
244
+ excludeOptions []string
230
245
strategy * GenerateStrategy
231
246
path []string
232
247
protocPath []string
@@ -258,6 +273,7 @@ func newGeneratePluginConfigFromExternalV1Beta1(
258
273
opt ,
259
274
false ,
260
275
false ,
276
+ nil , // TODO
261
277
strategy ,
262
278
[]string {externalConfig .Path },
263
279
)
@@ -268,6 +284,7 @@ func newGeneratePluginConfigFromExternalV1Beta1(
268
284
opt ,
269
285
false ,
270
286
false ,
287
+ nil , // TODO
271
288
strategy ,
272
289
)
273
290
}
@@ -327,6 +344,7 @@ func newGeneratePluginConfigFromExternalV1(
327
344
opt ,
328
345
false ,
329
346
false ,
347
+ nil , // TODO
330
348
externalConfig .Revision ,
331
349
)
332
350
}
@@ -339,6 +357,7 @@ func newGeneratePluginConfigFromExternalV1(
339
357
opt ,
340
358
false ,
341
359
false ,
360
+ nil , // TODO
342
361
strategy ,
343
362
path ,
344
363
)
@@ -350,6 +369,7 @@ func newGeneratePluginConfigFromExternalV1(
350
369
opt ,
351
370
false ,
352
371
false ,
372
+ nil , // TODO
353
373
strategy ,
354
374
protocPath ,
355
375
)
@@ -362,6 +382,7 @@ func newGeneratePluginConfigFromExternalV1(
362
382
opt ,
363
383
false ,
364
384
false ,
385
+ nil , // TODO
365
386
strategy ,
366
387
)
367
388
}
@@ -418,6 +439,7 @@ func newGeneratePluginConfigFromExternalV2(
418
439
opt ,
419
440
externalConfig .IncludeImports ,
420
441
externalConfig .IncludeWKT ,
442
+ externalConfig .ExcludeOptions ,
421
443
revision ,
422
444
)
423
445
case externalConfig .Local != nil :
@@ -438,6 +460,7 @@ func newGeneratePluginConfigFromExternalV2(
438
460
opt ,
439
461
externalConfig .IncludeImports ,
440
462
externalConfig .IncludeWKT ,
463
+ externalConfig .ExcludeOptions ,
441
464
parsedStrategy ,
442
465
path ,
443
466
)
@@ -455,6 +478,7 @@ func newGeneratePluginConfigFromExternalV2(
455
478
opt ,
456
479
externalConfig .IncludeImports ,
457
480
externalConfig .IncludeWKT ,
481
+ externalConfig .ExcludeOptions ,
458
482
parsedStrategy ,
459
483
protocPath ,
460
484
)
@@ -469,6 +493,7 @@ func newRemoteGeneratePluginConfig(
469
493
opt []string ,
470
494
includeImports bool ,
471
495
includeWKT bool ,
496
+ excludeOptions []string ,
472
497
revision int ,
473
498
) (* generatePluginConfig , error ) {
474
499
if includeWKT && ! includeImports {
@@ -490,6 +515,7 @@ func newRemoteGeneratePluginConfig(
490
515
opts : opt ,
491
516
includeImports : includeImports ,
492
517
includeWKT : includeWKT ,
518
+ excludeOptions : excludeOptions ,
493
519
}, nil
494
520
}
495
521
@@ -499,6 +525,7 @@ func newLocalOrProtocBuiltinGeneratePluginConfig(
499
525
opt []string ,
500
526
includeImports bool ,
501
527
includeWKT bool ,
528
+ excludeOptions []string ,
502
529
strategy * GenerateStrategy ,
503
530
) (* generatePluginConfig , error ) {
504
531
if includeWKT && ! includeImports {
@@ -512,6 +539,7 @@ func newLocalOrProtocBuiltinGeneratePluginConfig(
512
539
opts : opt ,
513
540
includeImports : includeImports ,
514
541
includeWKT : includeWKT ,
542
+ excludeOptions : excludeOptions ,
515
543
}, nil
516
544
}
517
545
@@ -521,6 +549,7 @@ func newLocalGeneratePluginConfig(
521
549
opt []string ,
522
550
includeImports bool ,
523
551
includeWKT bool ,
552
+ excludeOptions []string ,
524
553
strategy * GenerateStrategy ,
525
554
path []string ,
526
555
) (* generatePluginConfig , error ) {
@@ -539,6 +568,7 @@ func newLocalGeneratePluginConfig(
539
568
opts : opt ,
540
569
includeImports : includeImports ,
541
570
includeWKT : includeWKT ,
571
+ excludeOptions : excludeOptions ,
542
572
}, nil
543
573
}
544
574
@@ -548,6 +578,7 @@ func newProtocBuiltinGeneratePluginConfig(
548
578
opt []string ,
549
579
includeImports bool ,
550
580
includeWKT bool ,
581
+ excludeOptions []string ,
551
582
strategy * GenerateStrategy ,
552
583
protocPath []string ,
553
584
) (* generatePluginConfig , error ) {
@@ -563,6 +594,7 @@ func newProtocBuiltinGeneratePluginConfig(
563
594
strategy : strategy ,
564
595
includeImports : includeImports ,
565
596
includeWKT : includeWKT ,
597
+ excludeOptions : excludeOptions ,
566
598
}, nil
567
599
}
568
600
@@ -590,6 +622,10 @@ func (p *generatePluginConfig) IncludeWKT() bool {
590
622
return p .includeWKT
591
623
}
592
624
625
+ func (p * generatePluginConfig ) ExcludeOptions () []string {
626
+ return p .excludeOptions
627
+ }
628
+
593
629
func (p * generatePluginConfig ) Strategy () GenerateStrategy {
594
630
if p .strategy == nil {
595
631
return GenerateStrategyDirectory
0 commit comments