| 1 |
// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT. |
| 2 |
|
| 3 |
package otelconf |
| 4 |
|
| 5 |
import "encoding/json" |
| 6 |
import "fmt" |
| 7 |
import "reflect" |
| 8 |
|
| 9 |
type AttributeLimits struct { |
| 10 |
// AttributeCountLimit corresponds to the JSON schema field |
| 11 |
// "attribute_count_limit". |
| 12 |
AttributeCountLimit *int `json:"attribute_count_limit,omitempty" yaml:"attribute_count_limit,omitempty" mapstructure:"attribute_count_limit,omitempty"` |
| 13 |
|
| 14 |
// AttributeValueLengthLimit corresponds to the JSON schema field |
| 15 |
// "attribute_value_length_limit". |
| 16 |
AttributeValueLengthLimit *int `json:"attribute_value_length_limit,omitempty" yaml:"attribute_value_length_limit,omitempty" mapstructure:"attribute_value_length_limit,omitempty"` |
| 17 |
|
| 18 |
AdditionalProperties interface{} |
| 19 |
} |
| 20 |
|
| 21 |
type Attributes map[string]interface{} |
| 22 |
|
| 23 |
type BatchLogRecordProcessor struct { |
| 24 |
// ExportTimeout corresponds to the JSON schema field "export_timeout". |
| 25 |
ExportTimeout *int `json:"export_timeout,omitempty" yaml:"export_timeout,omitempty" mapstructure:"export_timeout,omitempty"` |
| 26 |
|
| 27 |
// Exporter corresponds to the JSON schema field "exporter". |
| 28 |
Exporter LogRecordExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` |
| 29 |
|
| 30 |
// MaxExportBatchSize corresponds to the JSON schema field |
| 31 |
// "max_export_batch_size". |
| 32 |
MaxExportBatchSize *int `json:"max_export_batch_size,omitempty" yaml:"max_export_batch_size,omitempty" mapstructure:"max_export_batch_size,omitempty"` |
| 33 |
|
| 34 |
// MaxQueueSize corresponds to the JSON schema field "max_queue_size". |
| 35 |
MaxQueueSize *int `json:"max_queue_size,omitempty" yaml:"max_queue_size,omitempty" mapstructure:"max_queue_size,omitempty"` |
| 36 |
|
| 37 |
// ScheduleDelay corresponds to the JSON schema field "schedule_delay". |
| 38 |
ScheduleDelay *int `json:"schedule_delay,omitempty" yaml:"schedule_delay,omitempty" mapstructure:"schedule_delay,omitempty"` |
| 39 |
} |
| 40 |
|
| 41 |
// UnmarshalJSON implements json.Unmarshaler. |
| 42 |
func (j *BatchLogRecordProcessor) UnmarshalJSON(b []byte) error { |
| 43 |
var raw map[string]interface{} |
| 44 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 45 |
return err |
| 46 |
} |
| 47 |
if _, ok := raw["exporter"]; raw != nil && !ok { |
| 48 |
return fmt.Errorf("field exporter in BatchLogRecordProcessor: required") |
| 49 |
} |
| 50 |
type Plain BatchLogRecordProcessor |
| 51 |
var plain Plain |
| 52 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 53 |
return err |
| 54 |
} |
| 55 |
*j = BatchLogRecordProcessor(plain) |
| 56 |
return nil |
| 57 |
} |
| 58 |
|
| 59 |
type BatchSpanProcessor struct { |
| 60 |
// ExportTimeout corresponds to the JSON schema field "export_timeout". |
| 61 |
ExportTimeout *int `json:"export_timeout,omitempty" yaml:"export_timeout,omitempty" mapstructure:"export_timeout,omitempty"` |
| 62 |
|
| 63 |
// Exporter corresponds to the JSON schema field "exporter". |
| 64 |
Exporter SpanExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` |
| 65 |
|
| 66 |
// MaxExportBatchSize corresponds to the JSON schema field |
| 67 |
// "max_export_batch_size". |
| 68 |
MaxExportBatchSize *int `json:"max_export_batch_size,omitempty" yaml:"max_export_batch_size,omitempty" mapstructure:"max_export_batch_size,omitempty"` |
| 69 |
|
| 70 |
// MaxQueueSize corresponds to the JSON schema field "max_queue_size". |
| 71 |
MaxQueueSize *int `json:"max_queue_size,omitempty" yaml:"max_queue_size,omitempty" mapstructure:"max_queue_size,omitempty"` |
| 72 |
|
| 73 |
// ScheduleDelay corresponds to the JSON schema field "schedule_delay". |
| 74 |
ScheduleDelay *int `json:"schedule_delay,omitempty" yaml:"schedule_delay,omitempty" mapstructure:"schedule_delay,omitempty"` |
| 75 |
} |
| 76 |
|
| 77 |
// UnmarshalJSON implements json.Unmarshaler. |
| 78 |
func (j *BatchSpanProcessor) UnmarshalJSON(b []byte) error { |
| 79 |
var raw map[string]interface{} |
| 80 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 81 |
return err |
| 82 |
} |
| 83 |
if _, ok := raw["exporter"]; raw != nil && !ok { |
| 84 |
return fmt.Errorf("field exporter in BatchSpanProcessor: required") |
| 85 |
} |
| 86 |
type Plain BatchSpanProcessor |
| 87 |
var plain Plain |
| 88 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 89 |
return err |
| 90 |
} |
| 91 |
*j = BatchSpanProcessor(plain) |
| 92 |
return nil |
| 93 |
} |
| 94 |
|
| 95 |
type Common map[string]interface{} |
| 96 |
|
| 97 |
type Console map[string]interface{} |
| 98 |
|
| 99 |
type Detectors struct { |
| 100 |
// Attributes corresponds to the JSON schema field "attributes". |
| 101 |
Attributes *DetectorsAttributes `json:"attributes,omitempty" yaml:"attributes,omitempty" mapstructure:"attributes,omitempty"` |
| 102 |
} |
| 103 |
|
| 104 |
type DetectorsAttributes struct { |
| 105 |
// Excluded corresponds to the JSON schema field "excluded". |
| 106 |
Excluded []string `json:"excluded,omitempty" yaml:"excluded,omitempty" mapstructure:"excluded,omitempty"` |
| 107 |
|
| 108 |
// Included corresponds to the JSON schema field "included". |
| 109 |
Included []string `json:"included,omitempty" yaml:"included,omitempty" mapstructure:"included,omitempty"` |
| 110 |
} |
| 111 |
|
| 112 |
type Headers map[string]string |
| 113 |
|
| 114 |
type IncludeExclude struct { |
| 115 |
// Excluded corresponds to the JSON schema field "excluded". |
| 116 |
Excluded []string `json:"excluded,omitempty" yaml:"excluded,omitempty" mapstructure:"excluded,omitempty"` |
| 117 |
|
| 118 |
// Included corresponds to the JSON schema field "included". |
| 119 |
Included []string `json:"included,omitempty" yaml:"included,omitempty" mapstructure:"included,omitempty"` |
| 120 |
} |
| 121 |
|
| 122 |
type LogRecordExporter struct { |
| 123 |
// Console corresponds to the JSON schema field "console". |
| 124 |
Console Console `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` |
| 125 |
|
| 126 |
// OTLP corresponds to the JSON schema field "otlp". |
| 127 |
OTLP *OTLP `json:"otlp,omitempty" yaml:"otlp,omitempty" mapstructure:"otlp,omitempty"` |
| 128 |
|
| 129 |
AdditionalProperties interface{} |
| 130 |
} |
| 131 |
|
| 132 |
type LogRecordLimits struct { |
| 133 |
// AttributeCountLimit corresponds to the JSON schema field |
| 134 |
// "attribute_count_limit". |
| 135 |
AttributeCountLimit *int `json:"attribute_count_limit,omitempty" yaml:"attribute_count_limit,omitempty" mapstructure:"attribute_count_limit,omitempty"` |
| 136 |
|
| 137 |
// AttributeValueLengthLimit corresponds to the JSON schema field |
| 138 |
// "attribute_value_length_limit". |
| 139 |
AttributeValueLengthLimit *int `json:"attribute_value_length_limit,omitempty" yaml:"attribute_value_length_limit,omitempty" mapstructure:"attribute_value_length_limit,omitempty"` |
| 140 |
} |
| 141 |
|
| 142 |
type LogRecordProcessor struct { |
| 143 |
// Batch corresponds to the JSON schema field "batch". |
| 144 |
Batch *BatchLogRecordProcessor `json:"batch,omitempty" yaml:"batch,omitempty" mapstructure:"batch,omitempty"` |
| 145 |
|
| 146 |
// Simple corresponds to the JSON schema field "simple". |
| 147 |
Simple *SimpleLogRecordProcessor `json:"simple,omitempty" yaml:"simple,omitempty" mapstructure:"simple,omitempty"` |
| 148 |
|
| 149 |
AdditionalProperties interface{} |
| 150 |
} |
| 151 |
|
| 152 |
type LoggerProvider struct { |
| 153 |
// Limits corresponds to the JSON schema field "limits". |
| 154 |
Limits *LogRecordLimits `json:"limits,omitempty" yaml:"limits,omitempty" mapstructure:"limits,omitempty"` |
| 155 |
|
| 156 |
// Processors corresponds to the JSON schema field "processors". |
| 157 |
Processors []LogRecordProcessor `json:"processors,omitempty" yaml:"processors,omitempty" mapstructure:"processors,omitempty"` |
| 158 |
} |
| 159 |
|
| 160 |
type MeterProvider struct { |
| 161 |
// Readers corresponds to the JSON schema field "readers". |
| 162 |
Readers []MetricReader `json:"readers,omitempty" yaml:"readers,omitempty" mapstructure:"readers,omitempty"` |
| 163 |
|
| 164 |
// Views corresponds to the JSON schema field "views". |
| 165 |
Views []View `json:"views,omitempty" yaml:"views,omitempty" mapstructure:"views,omitempty"` |
| 166 |
} |
| 167 |
|
| 168 |
type MetricExporter struct { |
| 169 |
// Console corresponds to the JSON schema field "console". |
| 170 |
Console Console `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` |
| 171 |
|
| 172 |
// OTLP corresponds to the JSON schema field "otlp". |
| 173 |
OTLP *OTLPMetric `json:"otlp,omitempty" yaml:"otlp,omitempty" mapstructure:"otlp,omitempty"` |
| 174 |
|
| 175 |
// Prometheus corresponds to the JSON schema field "prometheus". |
| 176 |
Prometheus *Prometheus `json:"prometheus,omitempty" yaml:"prometheus,omitempty" mapstructure:"prometheus,omitempty"` |
| 177 |
|
| 178 |
AdditionalProperties interface{} |
| 179 |
} |
| 180 |
|
| 181 |
type MetricReader struct { |
| 182 |
// Periodic corresponds to the JSON schema field "periodic". |
| 183 |
Periodic *PeriodicMetricReader `json:"periodic,omitempty" yaml:"periodic,omitempty" mapstructure:"periodic,omitempty"` |
| 184 |
|
| 185 |
// Pull corresponds to the JSON schema field "pull". |
| 186 |
Pull *PullMetricReader `json:"pull,omitempty" yaml:"pull,omitempty" mapstructure:"pull,omitempty"` |
| 187 |
} |
| 188 |
|
| 189 |
type OTLP struct { |
| 190 |
// Certificate corresponds to the JSON schema field "certificate". |
| 191 |
Certificate *string `json:"certificate,omitempty" yaml:"certificate,omitempty" mapstructure:"certificate,omitempty"` |
| 192 |
|
| 193 |
// ClientCertificate corresponds to the JSON schema field "client_certificate". |
| 194 |
ClientCertificate *string `json:"client_certificate,omitempty" yaml:"client_certificate,omitempty" mapstructure:"client_certificate,omitempty"` |
| 195 |
|
| 196 |
// ClientKey corresponds to the JSON schema field "client_key". |
| 197 |
ClientKey *string `json:"client_key,omitempty" yaml:"client_key,omitempty" mapstructure:"client_key,omitempty"` |
| 198 |
|
| 199 |
// Compression corresponds to the JSON schema field "compression". |
| 200 |
Compression *string `json:"compression,omitempty" yaml:"compression,omitempty" mapstructure:"compression,omitempty"` |
| 201 |
|
| 202 |
// Endpoint corresponds to the JSON schema field "endpoint". |
| 203 |
Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"` |
| 204 |
|
| 205 |
// Headers corresponds to the JSON schema field "headers". |
| 206 |
Headers Headers `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers,omitempty"` |
| 207 |
|
| 208 |
// Insecure corresponds to the JSON schema field "insecure". |
| 209 |
Insecure *bool `json:"insecure,omitempty" yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"` |
| 210 |
|
| 211 |
// Protocol corresponds to the JSON schema field "protocol". |
| 212 |
Protocol string `json:"protocol" yaml:"protocol" mapstructure:"protocol"` |
| 213 |
|
| 214 |
// Timeout corresponds to the JSON schema field "timeout". |
| 215 |
Timeout *int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` |
| 216 |
} |
| 217 |
|
| 218 |
type OTLPMetric struct { |
| 219 |
// Certificate corresponds to the JSON schema field "certificate". |
| 220 |
Certificate *string `json:"certificate,omitempty" yaml:"certificate,omitempty" mapstructure:"certificate,omitempty"` |
| 221 |
|
| 222 |
// ClientCertificate corresponds to the JSON schema field "client_certificate". |
| 223 |
ClientCertificate *string `json:"client_certificate,omitempty" yaml:"client_certificate,omitempty" mapstructure:"client_certificate,omitempty"` |
| 224 |
|
| 225 |
// ClientKey corresponds to the JSON schema field "client_key". |
| 226 |
ClientKey *string `json:"client_key,omitempty" yaml:"client_key,omitempty" mapstructure:"client_key,omitempty"` |
| 227 |
|
| 228 |
// Compression corresponds to the JSON schema field "compression". |
| 229 |
Compression *string `json:"compression,omitempty" yaml:"compression,omitempty" mapstructure:"compression,omitempty"` |
| 230 |
|
| 231 |
// DefaultHistogramAggregation corresponds to the JSON schema field |
| 232 |
// "default_histogram_aggregation". |
| 233 |
DefaultHistogramAggregation *OTLPMetricDefaultHistogramAggregation `json:"default_histogram_aggregation,omitempty" yaml:"default_histogram_aggregation,omitempty" mapstructure:"default_histogram_aggregation,omitempty"` |
| 234 |
|
| 235 |
// Endpoint corresponds to the JSON schema field "endpoint". |
| 236 |
Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"` |
| 237 |
|
| 238 |
// Headers corresponds to the JSON schema field "headers". |
| 239 |
Headers Headers `json:"headers,omitempty" yaml:"headers,omitempty" mapstructure:"headers,omitempty"` |
| 240 |
|
| 241 |
// Insecure corresponds to the JSON schema field "insecure". |
| 242 |
Insecure *bool `json:"insecure,omitempty" yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"` |
| 243 |
|
| 244 |
// Protocol corresponds to the JSON schema field "protocol". |
| 245 |
Protocol string `json:"protocol" yaml:"protocol" mapstructure:"protocol"` |
| 246 |
|
| 247 |
// TemporalityPreference corresponds to the JSON schema field |
| 248 |
// "temporality_preference". |
| 249 |
TemporalityPreference *string `json:"temporality_preference,omitempty" yaml:"temporality_preference,omitempty" mapstructure:"temporality_preference,omitempty"` |
| 250 |
|
| 251 |
// Timeout corresponds to the JSON schema field "timeout". |
| 252 |
Timeout *int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` |
| 253 |
} |
| 254 |
|
| 255 |
type OTLPMetricDefaultHistogramAggregation string |
| 256 |
|
| 257 |
const OTLPMetricDefaultHistogramAggregationBase2ExponentialBucketHistogram OTLPMetricDefaultHistogramAggregation = "base2_exponential_bucket_histogram" |
| 258 |
const OTLPMetricDefaultHistogramAggregationExplicitBucketHistogram OTLPMetricDefaultHistogramAggregation = "explicit_bucket_histogram" |
| 259 |
|
| 260 |
var enumValues_OTLPMetricDefaultHistogramAggregation = []interface{}{ |
| 261 |
"explicit_bucket_histogram", |
| 262 |
"base2_exponential_bucket_histogram", |
| 263 |
} |
| 264 |
|
| 265 |
// UnmarshalJSON implements json.Unmarshaler. |
| 266 |
func (j *OTLPMetricDefaultHistogramAggregation) UnmarshalJSON(b []byte) error { |
| 267 |
var v string |
| 268 |
if err := json.Unmarshal(b, &v); err != nil { |
| 269 |
return err |
| 270 |
} |
| 271 |
var ok bool |
| 272 |
for _, expected := range enumValues_OTLPMetricDefaultHistogramAggregation { |
| 273 |
if reflect.DeepEqual(v, expected) { |
| 274 |
ok = true |
| 275 |
break |
| 276 |
} |
| 277 |
} |
| 278 |
if !ok { |
| 279 |
return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_OTLPMetricDefaultHistogramAggregation, v) |
| 280 |
} |
| 281 |
*j = OTLPMetricDefaultHistogramAggregation(v) |
| 282 |
return nil |
| 283 |
} |
| 284 |
|
| 285 |
// UnmarshalJSON implements json.Unmarshaler. |
| 286 |
func (j *OTLPMetric) UnmarshalJSON(b []byte) error { |
| 287 |
var raw map[string]interface{} |
| 288 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 289 |
return err |
| 290 |
} |
| 291 |
if _, ok := raw["endpoint"]; raw != nil && !ok { |
| 292 |
return fmt.Errorf("field endpoint in OTLPMetric: required") |
| 293 |
} |
| 294 |
if _, ok := raw["protocol"]; raw != nil && !ok { |
| 295 |
return fmt.Errorf("field protocol in OTLPMetric: required") |
| 296 |
} |
| 297 |
type Plain OTLPMetric |
| 298 |
var plain Plain |
| 299 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 300 |
return err |
| 301 |
} |
| 302 |
*j = OTLPMetric(plain) |
| 303 |
return nil |
| 304 |
} |
| 305 |
|
| 306 |
// UnmarshalJSON implements json.Unmarshaler. |
| 307 |
func (j *OTLP) UnmarshalJSON(b []byte) error { |
| 308 |
var raw map[string]interface{} |
| 309 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 310 |
return err |
| 311 |
} |
| 312 |
if _, ok := raw["endpoint"]; raw != nil && !ok { |
| 313 |
return fmt.Errorf("field endpoint in OTLP: required") |
| 314 |
} |
| 315 |
if _, ok := raw["protocol"]; raw != nil && !ok { |
| 316 |
return fmt.Errorf("field protocol in OTLP: required") |
| 317 |
} |
| 318 |
type Plain OTLP |
| 319 |
var plain Plain |
| 320 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 321 |
return err |
| 322 |
} |
| 323 |
*j = OTLP(plain) |
| 324 |
return nil |
| 325 |
} |
| 326 |
|
| 327 |
type OpenTelemetryConfiguration struct { |
| 328 |
// AttributeLimits corresponds to the JSON schema field "attribute_limits". |
| 329 |
AttributeLimits *AttributeLimits `json:"attribute_limits,omitempty" yaml:"attribute_limits,omitempty" mapstructure:"attribute_limits,omitempty"` |
| 330 |
|
| 331 |
// Disabled corresponds to the JSON schema field "disabled". |
| 332 |
Disabled *bool `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"` |
| 333 |
|
| 334 |
// FileFormat corresponds to the JSON schema field "file_format". |
| 335 |
FileFormat string `json:"file_format" yaml:"file_format" mapstructure:"file_format"` |
| 336 |
|
| 337 |
// LoggerProvider corresponds to the JSON schema field "logger_provider". |
| 338 |
LoggerProvider *LoggerProvider `json:"logger_provider,omitempty" yaml:"logger_provider,omitempty" mapstructure:"logger_provider,omitempty"` |
| 339 |
|
| 340 |
// MeterProvider corresponds to the JSON schema field "meter_provider". |
| 341 |
MeterProvider *MeterProvider `json:"meter_provider,omitempty" yaml:"meter_provider,omitempty" mapstructure:"meter_provider,omitempty"` |
| 342 |
|
| 343 |
// Propagator corresponds to the JSON schema field "propagator". |
| 344 |
Propagator *Propagator `json:"propagator,omitempty" yaml:"propagator,omitempty" mapstructure:"propagator,omitempty"` |
| 345 |
|
| 346 |
// Resource corresponds to the JSON schema field "resource". |
| 347 |
Resource *Resource `json:"resource,omitempty" yaml:"resource,omitempty" mapstructure:"resource,omitempty"` |
| 348 |
|
| 349 |
// TracerProvider corresponds to the JSON schema field "tracer_provider". |
| 350 |
TracerProvider *TracerProvider `json:"tracer_provider,omitempty" yaml:"tracer_provider,omitempty" mapstructure:"tracer_provider,omitempty"` |
| 351 |
|
| 352 |
AdditionalProperties interface{} |
| 353 |
} |
| 354 |
|
| 355 |
// UnmarshalJSON implements json.Unmarshaler. |
| 356 |
func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error { |
| 357 |
var raw map[string]interface{} |
| 358 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 359 |
return err |
| 360 |
} |
| 361 |
if _, ok := raw["file_format"]; raw != nil && !ok { |
| 362 |
return fmt.Errorf("field file_format in OpenTelemetryConfiguration: required") |
| 363 |
} |
| 364 |
type Plain OpenTelemetryConfiguration |
| 365 |
var plain Plain |
| 366 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 367 |
return err |
| 368 |
} |
| 369 |
*j = OpenTelemetryConfiguration(plain) |
| 370 |
return nil |
| 371 |
} |
| 372 |
|
| 373 |
type PeriodicMetricReader struct { |
| 374 |
// Exporter corresponds to the JSON schema field "exporter". |
| 375 |
Exporter MetricExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` |
| 376 |
|
| 377 |
// Interval corresponds to the JSON schema field "interval". |
| 378 |
Interval *int `json:"interval,omitempty" yaml:"interval,omitempty" mapstructure:"interval,omitempty"` |
| 379 |
|
| 380 |
// Timeout corresponds to the JSON schema field "timeout". |
| 381 |
Timeout *int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` |
| 382 |
} |
| 383 |
|
| 384 |
// UnmarshalJSON implements json.Unmarshaler. |
| 385 |
func (j *PeriodicMetricReader) UnmarshalJSON(b []byte) error { |
| 386 |
var raw map[string]interface{} |
| 387 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 388 |
return err |
| 389 |
} |
| 390 |
if _, ok := raw["exporter"]; raw != nil && !ok { |
| 391 |
return fmt.Errorf("field exporter in PeriodicMetricReader: required") |
| 392 |
} |
| 393 |
type Plain PeriodicMetricReader |
| 394 |
var plain Plain |
| 395 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 396 |
return err |
| 397 |
} |
| 398 |
*j = PeriodicMetricReader(plain) |
| 399 |
return nil |
| 400 |
} |
| 401 |
|
| 402 |
type Prometheus struct { |
| 403 |
// Host corresponds to the JSON schema field "host". |
| 404 |
Host *string `json:"host,omitempty" yaml:"host,omitempty" mapstructure:"host,omitempty"` |
| 405 |
|
| 406 |
// Port corresponds to the JSON schema field "port". |
| 407 |
Port *int `json:"port,omitempty" yaml:"port,omitempty" mapstructure:"port,omitempty"` |
| 408 |
|
| 409 |
// WithResourceConstantLabels corresponds to the JSON schema field |
| 410 |
// "with_resource_constant_labels". |
| 411 |
WithResourceConstantLabels *IncludeExclude `json:"with_resource_constant_labels,omitempty" yaml:"with_resource_constant_labels,omitempty" mapstructure:"with_resource_constant_labels,omitempty"` |
| 412 |
|
| 413 |
// WithoutScopeInfo corresponds to the JSON schema field "without_scope_info". |
| 414 |
WithoutScopeInfo *bool `json:"without_scope_info,omitempty" yaml:"without_scope_info,omitempty" mapstructure:"without_scope_info,omitempty"` |
| 415 |
|
| 416 |
// WithoutTypeSuffix corresponds to the JSON schema field "without_type_suffix". |
| 417 |
WithoutTypeSuffix *bool `json:"without_type_suffix,omitempty" yaml:"without_type_suffix,omitempty" mapstructure:"without_type_suffix,omitempty"` |
| 418 |
|
| 419 |
// WithoutUnits corresponds to the JSON schema field "without_units". |
| 420 |
WithoutUnits *bool `json:"without_units,omitempty" yaml:"without_units,omitempty" mapstructure:"without_units,omitempty"` |
| 421 |
} |
| 422 |
|
| 423 |
type Propagator struct { |
| 424 |
// Composite corresponds to the JSON schema field "composite". |
| 425 |
Composite []string `json:"composite,omitempty" yaml:"composite,omitempty" mapstructure:"composite,omitempty"` |
| 426 |
|
| 427 |
AdditionalProperties interface{} |
| 428 |
} |
| 429 |
|
| 430 |
type PullMetricReader struct { |
| 431 |
// Exporter corresponds to the JSON schema field "exporter". |
| 432 |
Exporter MetricExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` |
| 433 |
} |
| 434 |
|
| 435 |
// UnmarshalJSON implements json.Unmarshaler. |
| 436 |
func (j *PullMetricReader) UnmarshalJSON(b []byte) error { |
| 437 |
var raw map[string]interface{} |
| 438 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 439 |
return err |
| 440 |
} |
| 441 |
if _, ok := raw["exporter"]; raw != nil && !ok { |
| 442 |
return fmt.Errorf("field exporter in PullMetricReader: required") |
| 443 |
} |
| 444 |
type Plain PullMetricReader |
| 445 |
var plain Plain |
| 446 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 447 |
return err |
| 448 |
} |
| 449 |
*j = PullMetricReader(plain) |
| 450 |
return nil |
| 451 |
} |
| 452 |
|
| 453 |
type Resource struct { |
| 454 |
// Attributes corresponds to the JSON schema field "attributes". |
| 455 |
Attributes Attributes `json:"attributes,omitempty" yaml:"attributes,omitempty" mapstructure:"attributes,omitempty"` |
| 456 |
|
| 457 |
// Detectors corresponds to the JSON schema field "detectors". |
| 458 |
Detectors *Detectors `json:"detectors,omitempty" yaml:"detectors,omitempty" mapstructure:"detectors,omitempty"` |
| 459 |
|
| 460 |
// SchemaUrl corresponds to the JSON schema field "schema_url". |
| 461 |
SchemaUrl *string `json:"schema_url,omitempty" yaml:"schema_url,omitempty" mapstructure:"schema_url,omitempty"` |
| 462 |
} |
| 463 |
|
| 464 |
type Sampler struct { |
| 465 |
// AlwaysOff corresponds to the JSON schema field "always_off". |
| 466 |
AlwaysOff SamplerAlwaysOff `json:"always_off,omitempty" yaml:"always_off,omitempty" mapstructure:"always_off,omitempty"` |
| 467 |
|
| 468 |
// AlwaysOn corresponds to the JSON schema field "always_on". |
| 469 |
AlwaysOn SamplerAlwaysOn `json:"always_on,omitempty" yaml:"always_on,omitempty" mapstructure:"always_on,omitempty"` |
| 470 |
|
| 471 |
// JaegerRemote corresponds to the JSON schema field "jaeger_remote". |
| 472 |
JaegerRemote *SamplerJaegerRemote `json:"jaeger_remote,omitempty" yaml:"jaeger_remote,omitempty" mapstructure:"jaeger_remote,omitempty"` |
| 473 |
|
| 474 |
// ParentBased corresponds to the JSON schema field "parent_based". |
| 475 |
ParentBased *SamplerParentBased `json:"parent_based,omitempty" yaml:"parent_based,omitempty" mapstructure:"parent_based,omitempty"` |
| 476 |
|
| 477 |
// TraceIDRatioBased corresponds to the JSON schema field "trace_id_ratio_based". |
| 478 |
TraceIDRatioBased *SamplerTraceIDRatioBased `json:"trace_id_ratio_based,omitempty" yaml:"trace_id_ratio_based,omitempty" mapstructure:"trace_id_ratio_based,omitempty"` |
| 479 |
|
| 480 |
AdditionalProperties interface{} |
| 481 |
} |
| 482 |
|
| 483 |
type SamplerAlwaysOff map[string]interface{} |
| 484 |
|
| 485 |
type SamplerAlwaysOn map[string]interface{} |
| 486 |
|
| 487 |
type SamplerJaegerRemote struct { |
| 488 |
// Endpoint corresponds to the JSON schema field "endpoint". |
| 489 |
Endpoint *string `json:"endpoint,omitempty" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"` |
| 490 |
|
| 491 |
// InitialSampler corresponds to the JSON schema field "initial_sampler". |
| 492 |
InitialSampler *Sampler `json:"initial_sampler,omitempty" yaml:"initial_sampler,omitempty" mapstructure:"initial_sampler,omitempty"` |
| 493 |
|
| 494 |
// Interval corresponds to the JSON schema field "interval". |
| 495 |
Interval *int `json:"interval,omitempty" yaml:"interval,omitempty" mapstructure:"interval,omitempty"` |
| 496 |
} |
| 497 |
|
| 498 |
type SamplerParentBased struct { |
| 499 |
// LocalParentNotSampled corresponds to the JSON schema field |
| 500 |
// "local_parent_not_sampled". |
| 501 |
LocalParentNotSampled *Sampler `json:"local_parent_not_sampled,omitempty" yaml:"local_parent_not_sampled,omitempty" mapstructure:"local_parent_not_sampled,omitempty"` |
| 502 |
|
| 503 |
// LocalParentSampled corresponds to the JSON schema field "local_parent_sampled". |
| 504 |
LocalParentSampled *Sampler `json:"local_parent_sampled,omitempty" yaml:"local_parent_sampled,omitempty" mapstructure:"local_parent_sampled,omitempty"` |
| 505 |
|
| 506 |
// RemoteParentNotSampled corresponds to the JSON schema field |
| 507 |
// "remote_parent_not_sampled". |
| 508 |
RemoteParentNotSampled *Sampler `json:"remote_parent_not_sampled,omitempty" yaml:"remote_parent_not_sampled,omitempty" mapstructure:"remote_parent_not_sampled,omitempty"` |
| 509 |
|
| 510 |
// RemoteParentSampled corresponds to the JSON schema field |
| 511 |
// "remote_parent_sampled". |
| 512 |
RemoteParentSampled *Sampler `json:"remote_parent_sampled,omitempty" yaml:"remote_parent_sampled,omitempty" mapstructure:"remote_parent_sampled,omitempty"` |
| 513 |
|
| 514 |
// Root corresponds to the JSON schema field "root". |
| 515 |
Root *Sampler `json:"root,omitempty" yaml:"root,omitempty" mapstructure:"root,omitempty"` |
| 516 |
} |
| 517 |
|
| 518 |
type SamplerTraceIDRatioBased struct { |
| 519 |
// Ratio corresponds to the JSON schema field "ratio". |
| 520 |
Ratio *float64 `json:"ratio,omitempty" yaml:"ratio,omitempty" mapstructure:"ratio,omitempty"` |
| 521 |
} |
| 522 |
|
| 523 |
type SimpleLogRecordProcessor struct { |
| 524 |
// Exporter corresponds to the JSON schema field "exporter". |
| 525 |
Exporter LogRecordExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` |
| 526 |
} |
| 527 |
|
| 528 |
// UnmarshalJSON implements json.Unmarshaler. |
| 529 |
func (j *SimpleLogRecordProcessor) UnmarshalJSON(b []byte) error { |
| 530 |
var raw map[string]interface{} |
| 531 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 532 |
return err |
| 533 |
} |
| 534 |
if _, ok := raw["exporter"]; raw != nil && !ok { |
| 535 |
return fmt.Errorf("field exporter in SimpleLogRecordProcessor: required") |
| 536 |
} |
| 537 |
type Plain SimpleLogRecordProcessor |
| 538 |
var plain Plain |
| 539 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 540 |
return err |
| 541 |
} |
| 542 |
*j = SimpleLogRecordProcessor(plain) |
| 543 |
return nil |
| 544 |
} |
| 545 |
|
| 546 |
type SimpleSpanProcessor struct { |
| 547 |
// Exporter corresponds to the JSON schema field "exporter". |
| 548 |
Exporter SpanExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"` |
| 549 |
} |
| 550 |
|
| 551 |
// UnmarshalJSON implements json.Unmarshaler. |
| 552 |
func (j *SimpleSpanProcessor) UnmarshalJSON(b []byte) error { |
| 553 |
var raw map[string]interface{} |
| 554 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 555 |
return err |
| 556 |
} |
| 557 |
if _, ok := raw["exporter"]; raw != nil && !ok { |
| 558 |
return fmt.Errorf("field exporter in SimpleSpanProcessor: required") |
| 559 |
} |
| 560 |
type Plain SimpleSpanProcessor |
| 561 |
var plain Plain |
| 562 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 563 |
return err |
| 564 |
} |
| 565 |
*j = SimpleSpanProcessor(plain) |
| 566 |
return nil |
| 567 |
} |
| 568 |
|
| 569 |
type SpanExporter struct { |
| 570 |
// Console corresponds to the JSON schema field "console". |
| 571 |
Console Console `json:"console,omitempty" yaml:"console,omitempty" mapstructure:"console,omitempty"` |
| 572 |
|
| 573 |
// OTLP corresponds to the JSON schema field "otlp". |
| 574 |
OTLP *OTLP `json:"otlp,omitempty" yaml:"otlp,omitempty" mapstructure:"otlp,omitempty"` |
| 575 |
|
| 576 |
// Zipkin corresponds to the JSON schema field "zipkin". |
| 577 |
Zipkin *Zipkin `json:"zipkin,omitempty" yaml:"zipkin,omitempty" mapstructure:"zipkin,omitempty"` |
| 578 |
|
| 579 |
AdditionalProperties interface{} |
| 580 |
} |
| 581 |
|
| 582 |
type SpanLimits struct { |
| 583 |
// AttributeCountLimit corresponds to the JSON schema field |
| 584 |
// "attribute_count_limit". |
| 585 |
AttributeCountLimit *int `json:"attribute_count_limit,omitempty" yaml:"attribute_count_limit,omitempty" mapstructure:"attribute_count_limit,omitempty"` |
| 586 |
|
| 587 |
// AttributeValueLengthLimit corresponds to the JSON schema field |
| 588 |
// "attribute_value_length_limit". |
| 589 |
AttributeValueLengthLimit *int `json:"attribute_value_length_limit,omitempty" yaml:"attribute_value_length_limit,omitempty" mapstructure:"attribute_value_length_limit,omitempty"` |
| 590 |
|
| 591 |
// EventAttributeCountLimit corresponds to the JSON schema field |
| 592 |
// "event_attribute_count_limit". |
| 593 |
EventAttributeCountLimit *int `json:"event_attribute_count_limit,omitempty" yaml:"event_attribute_count_limit,omitempty" mapstructure:"event_attribute_count_limit,omitempty"` |
| 594 |
|
| 595 |
// EventCountLimit corresponds to the JSON schema field "event_count_limit". |
| 596 |
EventCountLimit *int `json:"event_count_limit,omitempty" yaml:"event_count_limit,omitempty" mapstructure:"event_count_limit,omitempty"` |
| 597 |
|
| 598 |
// LinkAttributeCountLimit corresponds to the JSON schema field |
| 599 |
// "link_attribute_count_limit". |
| 600 |
LinkAttributeCountLimit *int `json:"link_attribute_count_limit,omitempty" yaml:"link_attribute_count_limit,omitempty" mapstructure:"link_attribute_count_limit,omitempty"` |
| 601 |
|
| 602 |
// LinkCountLimit corresponds to the JSON schema field "link_count_limit". |
| 603 |
LinkCountLimit *int `json:"link_count_limit,omitempty" yaml:"link_count_limit,omitempty" mapstructure:"link_count_limit,omitempty"` |
| 604 |
} |
| 605 |
|
| 606 |
type SpanProcessor struct { |
| 607 |
// Batch corresponds to the JSON schema field "batch". |
| 608 |
Batch *BatchSpanProcessor `json:"batch,omitempty" yaml:"batch,omitempty" mapstructure:"batch,omitempty"` |
| 609 |
|
| 610 |
// Simple corresponds to the JSON schema field "simple". |
| 611 |
Simple *SimpleSpanProcessor `json:"simple,omitempty" yaml:"simple,omitempty" mapstructure:"simple,omitempty"` |
| 612 |
|
| 613 |
AdditionalProperties interface{} |
| 614 |
} |
| 615 |
|
| 616 |
type TracerProvider struct { |
| 617 |
// Limits corresponds to the JSON schema field "limits". |
| 618 |
Limits *SpanLimits `json:"limits,omitempty" yaml:"limits,omitempty" mapstructure:"limits,omitempty"` |
| 619 |
|
| 620 |
// Processors corresponds to the JSON schema field "processors". |
| 621 |
Processors []SpanProcessor `json:"processors,omitempty" yaml:"processors,omitempty" mapstructure:"processors,omitempty"` |
| 622 |
|
| 623 |
// Sampler corresponds to the JSON schema field "sampler". |
| 624 |
Sampler *Sampler `json:"sampler,omitempty" yaml:"sampler,omitempty" mapstructure:"sampler,omitempty"` |
| 625 |
} |
| 626 |
|
| 627 |
type View struct { |
| 628 |
// Selector corresponds to the JSON schema field "selector". |
| 629 |
Selector *ViewSelector `json:"selector,omitempty" yaml:"selector,omitempty" mapstructure:"selector,omitempty"` |
| 630 |
|
| 631 |
// Stream corresponds to the JSON schema field "stream". |
| 632 |
Stream *ViewStream `json:"stream,omitempty" yaml:"stream,omitempty" mapstructure:"stream,omitempty"` |
| 633 |
} |
| 634 |
|
| 635 |
type ViewSelector struct { |
| 636 |
// InstrumentName corresponds to the JSON schema field "instrument_name". |
| 637 |
InstrumentName *string `json:"instrument_name,omitempty" yaml:"instrument_name,omitempty" mapstructure:"instrument_name,omitempty"` |
| 638 |
|
| 639 |
// InstrumentType corresponds to the JSON schema field "instrument_type". |
| 640 |
InstrumentType *ViewSelectorInstrumentType `json:"instrument_type,omitempty" yaml:"instrument_type,omitempty" mapstructure:"instrument_type,omitempty"` |
| 641 |
|
| 642 |
// MeterName corresponds to the JSON schema field "meter_name". |
| 643 |
MeterName *string `json:"meter_name,omitempty" yaml:"meter_name,omitempty" mapstructure:"meter_name,omitempty"` |
| 644 |
|
| 645 |
// MeterSchemaUrl corresponds to the JSON schema field "meter_schema_url". |
| 646 |
MeterSchemaUrl *string `json:"meter_schema_url,omitempty" yaml:"meter_schema_url,omitempty" mapstructure:"meter_schema_url,omitempty"` |
| 647 |
|
| 648 |
// MeterVersion corresponds to the JSON schema field "meter_version". |
| 649 |
MeterVersion *string `json:"meter_version,omitempty" yaml:"meter_version,omitempty" mapstructure:"meter_version,omitempty"` |
| 650 |
|
| 651 |
// Unit corresponds to the JSON schema field "unit". |
| 652 |
Unit *string `json:"unit,omitempty" yaml:"unit,omitempty" mapstructure:"unit,omitempty"` |
| 653 |
} |
| 654 |
|
| 655 |
type ViewSelectorInstrumentType string |
| 656 |
|
| 657 |
const ViewSelectorInstrumentTypeCounter ViewSelectorInstrumentType = "counter" |
| 658 |
const ViewSelectorInstrumentTypeHistogram ViewSelectorInstrumentType = "histogram" |
| 659 |
const ViewSelectorInstrumentTypeObservableCounter ViewSelectorInstrumentType = "observable_counter" |
| 660 |
const ViewSelectorInstrumentTypeObservableGauge ViewSelectorInstrumentType = "observable_gauge" |
| 661 |
const ViewSelectorInstrumentTypeObservableUpDownCounter ViewSelectorInstrumentType = "observable_up_down_counter" |
| 662 |
const ViewSelectorInstrumentTypeUpDownCounter ViewSelectorInstrumentType = "up_down_counter" |
| 663 |
|
| 664 |
var enumValues_ViewSelectorInstrumentType = []interface{}{ |
| 665 |
"counter", |
| 666 |
"histogram", |
| 667 |
"observable_counter", |
| 668 |
"observable_gauge", |
| 669 |
"observable_up_down_counter", |
| 670 |
"up_down_counter", |
| 671 |
} |
| 672 |
|
| 673 |
// UnmarshalJSON implements json.Unmarshaler. |
| 674 |
func (j *ViewSelectorInstrumentType) UnmarshalJSON(b []byte) error { |
| 675 |
var v string |
| 676 |
if err := json.Unmarshal(b, &v); err != nil { |
| 677 |
return err |
| 678 |
} |
| 679 |
var ok bool |
| 680 |
for _, expected := range enumValues_ViewSelectorInstrumentType { |
| 681 |
if reflect.DeepEqual(v, expected) { |
| 682 |
ok = true |
| 683 |
break |
| 684 |
} |
| 685 |
} |
| 686 |
if !ok { |
| 687 |
return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_ViewSelectorInstrumentType, v) |
| 688 |
} |
| 689 |
*j = ViewSelectorInstrumentType(v) |
| 690 |
return nil |
| 691 |
} |
| 692 |
|
| 693 |
type ViewStream struct { |
| 694 |
// Aggregation corresponds to the JSON schema field "aggregation". |
| 695 |
Aggregation *ViewStreamAggregation `json:"aggregation,omitempty" yaml:"aggregation,omitempty" mapstructure:"aggregation,omitempty"` |
| 696 |
|
| 697 |
// AttributeKeys corresponds to the JSON schema field "attribute_keys". |
| 698 |
AttributeKeys []string `json:"attribute_keys,omitempty" yaml:"attribute_keys,omitempty" mapstructure:"attribute_keys,omitempty"` |
| 699 |
|
| 700 |
// Description corresponds to the JSON schema field "description". |
| 701 |
Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"` |
| 702 |
|
| 703 |
// Name corresponds to the JSON schema field "name". |
| 704 |
Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"` |
| 705 |
} |
| 706 |
|
| 707 |
type ViewStreamAggregation struct { |
| 708 |
// Base2ExponentialBucketHistogram corresponds to the JSON schema field |
| 709 |
// "base2_exponential_bucket_histogram". |
| 710 |
Base2ExponentialBucketHistogram *ViewStreamAggregationBase2ExponentialBucketHistogram `json:"base2_exponential_bucket_histogram,omitempty" yaml:"base2_exponential_bucket_histogram,omitempty" mapstructure:"base2_exponential_bucket_histogram,omitempty"` |
| 711 |
|
| 712 |
// Default corresponds to the JSON schema field "default". |
| 713 |
Default ViewStreamAggregationDefault `json:"default,omitempty" yaml:"default,omitempty" mapstructure:"default,omitempty"` |
| 714 |
|
| 715 |
// Drop corresponds to the JSON schema field "drop". |
| 716 |
Drop ViewStreamAggregationDrop `json:"drop,omitempty" yaml:"drop,omitempty" mapstructure:"drop,omitempty"` |
| 717 |
|
| 718 |
// ExplicitBucketHistogram corresponds to the JSON schema field |
| 719 |
// "explicit_bucket_histogram". |
| 720 |
ExplicitBucketHistogram *ViewStreamAggregationExplicitBucketHistogram `json:"explicit_bucket_histogram,omitempty" yaml:"explicit_bucket_histogram,omitempty" mapstructure:"explicit_bucket_histogram,omitempty"` |
| 721 |
|
| 722 |
// LastValue corresponds to the JSON schema field "last_value". |
| 723 |
LastValue ViewStreamAggregationLastValue `json:"last_value,omitempty" yaml:"last_value,omitempty" mapstructure:"last_value,omitempty"` |
| 724 |
|
| 725 |
// Sum corresponds to the JSON schema field "sum". |
| 726 |
Sum ViewStreamAggregationSum `json:"sum,omitempty" yaml:"sum,omitempty" mapstructure:"sum,omitempty"` |
| 727 |
} |
| 728 |
|
| 729 |
type ViewStreamAggregationBase2ExponentialBucketHistogram struct { |
| 730 |
// MaxScale corresponds to the JSON schema field "max_scale". |
| 731 |
MaxScale *int `json:"max_scale,omitempty" yaml:"max_scale,omitempty" mapstructure:"max_scale,omitempty"` |
| 732 |
|
| 733 |
// MaxSize corresponds to the JSON schema field "max_size". |
| 734 |
MaxSize *int `json:"max_size,omitempty" yaml:"max_size,omitempty" mapstructure:"max_size,omitempty"` |
| 735 |
|
| 736 |
// RecordMinMax corresponds to the JSON schema field "record_min_max". |
| 737 |
RecordMinMax *bool `json:"record_min_max,omitempty" yaml:"record_min_max,omitempty" mapstructure:"record_min_max,omitempty"` |
| 738 |
} |
| 739 |
|
| 740 |
type ViewStreamAggregationDefault map[string]interface{} |
| 741 |
|
| 742 |
type ViewStreamAggregationDrop map[string]interface{} |
| 743 |
|
| 744 |
type ViewStreamAggregationExplicitBucketHistogram struct { |
| 745 |
// Boundaries corresponds to the JSON schema field "boundaries". |
| 746 |
Boundaries []float64 `json:"boundaries,omitempty" yaml:"boundaries,omitempty" mapstructure:"boundaries,omitempty"` |
| 747 |
|
| 748 |
// RecordMinMax corresponds to the JSON schema field "record_min_max". |
| 749 |
RecordMinMax *bool `json:"record_min_max,omitempty" yaml:"record_min_max,omitempty" mapstructure:"record_min_max,omitempty"` |
| 750 |
} |
| 751 |
|
| 752 |
type ViewStreamAggregationLastValue map[string]interface{} |
| 753 |
|
| 754 |
type ViewStreamAggregationSum map[string]interface{} |
| 755 |
|
| 756 |
type Zipkin struct { |
| 757 |
// Endpoint corresponds to the JSON schema field "endpoint". |
| 758 |
Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"` |
| 759 |
|
| 760 |
// Timeout corresponds to the JSON schema field "timeout". |
| 761 |
Timeout *int `json:"timeout,omitempty" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"` |
| 762 |
} |
| 763 |
|
| 764 |
// UnmarshalJSON implements json.Unmarshaler. |
| 765 |
func (j *Zipkin) UnmarshalJSON(b []byte) error { |
| 766 |
var raw map[string]interface{} |
| 767 |
if err := json.Unmarshal(b, &raw); err != nil { |
| 768 |
return err |
| 769 |
} |
| 770 |
if _, ok := raw["endpoint"]; raw != nil && !ok { |
| 771 |
return fmt.Errorf("field endpoint in Zipkin: required") |
| 772 |
} |
| 773 |
type Plain Zipkin |
| 774 |
var plain Plain |
| 775 |
if err := json.Unmarshal(b, &plain); err != nil { |
| 776 |
return err |
| 777 |
} |
| 778 |
*j = Zipkin(plain) |
| 779 |
return nil |
| 780 |
} |