// Copyright The OpenTelemetry Authors// SPDX-License-Identifier: Apache-2.0package telemetryimport ()// Scope is the identifying values of the instrumentation scope.typeScopestruct { Name string`json:"name,omitempty"` Version string`json:"version,omitempty"` Attrs []Attr`json:"attributes,omitempty"` DroppedAttrs uint32`json:"droppedAttributesCount,omitempty"`}// UnmarshalJSON decodes the OTLP formatted JSON contained in data into r.func ( *Scope) ( []byte) error { := json.NewDecoder(bytes.NewReader()) , := .Token()if != nil {return }if != json.Delim('{') {returnerrors.New("invalid Scope type") }for .More() { , := .Token()if != nil {iferrors.Is(, io.EOF) {// Empty.returnnil }return } , := .(string)if ! {returnfmt.Errorf("invalid Scope field: %#v", ) }switch {case"name": = .Decode(&.Name)case"version": = .Decode(&.Version)case"attributes": = .Decode(&.Attrs)case"droppedAttributesCount", "dropped_attributes_count": = .Decode(&.DroppedAttrs)default:// Skip unknown. }if != nil {return } }returnnil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.