Debian Codegraph @

pdata/internal/wrapper_profiles.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package internal // import "go.opentelemetry.io/collector/pdata/internal"
5
6 // ProfilesToProto internal helper to convert Profiles to protobuf representation.
7 func ProfilesToProto(l ProfilesWrapper) ProfilesData {
8 return ProfilesData{
9 ResourceProfiles: l.orig.ResourceProfiles,
10 Dictionary: l.orig.Dictionary,
11 }
12 }
13
14 // ProfilesFromProto internal helper to convert protobuf representation to Profiles.
15 // This function set exclusive state assuming that it's called only once per Profiles.
16 func ProfilesFromProto(orig ProfilesData) ProfilesWrapper {
17 return NewProfilesWrapper(&ExportProfilesServiceRequest{
18 ResourceProfiles: orig.ResourceProfiles,
19 Dictionary: orig.Dictionary,
20 }, NewState())
21 }