-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdatadog.pb.clone.go
102 lines (80 loc) · 2.9 KB
/
datadog.pb.clone.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Code generated by protoc-gen-ext. DO NOT EDIT.
// source: github.com/solo-io/solo-apis/api/gloo/gloo/external/envoy/config/trace/v3/datadog.proto
package v3
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"strings"
"github.com/solo-io/protoc-gen-ext/pkg/clone"
"google.golang.org/protobuf/proto"
github_com_golang_protobuf_ptypes_duration "github.com/golang/protobuf/ptypes/duration"
github_com_golang_protobuf_ptypes_wrappers "github.com/golang/protobuf/ptypes/wrappers"
github_com_solo_io_solo_kit_pkg_api_v1_resources_core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
)
// ensure the imports are used
var (
_ = errors.New("")
_ = fmt.Print
_ = binary.LittleEndian
_ = bytes.Compare
_ = strings.Compare
_ = clone.Cloner(nil)
_ = proto.Message(nil)
)
// Clone function
func (m *DatadogRemoteConfig) Clone() proto.Message {
var target *DatadogRemoteConfig
if m == nil {
return target
}
target = &DatadogRemoteConfig{}
if h, ok := interface{}(m.GetPollingInterval()).(clone.Cloner); ok {
target.PollingInterval = h.Clone().(*github_com_golang_protobuf_ptypes_duration.Duration)
} else {
target.PollingInterval = proto.Clone(m.GetPollingInterval()).(*github_com_golang_protobuf_ptypes_duration.Duration)
}
if h, ok := interface{}(m.GetDisabled()).(clone.Cloner); ok {
target.Disabled = h.Clone().(*github_com_golang_protobuf_ptypes_wrappers.BoolValue)
} else {
target.Disabled = proto.Clone(m.GetDisabled()).(*github_com_golang_protobuf_ptypes_wrappers.BoolValue)
}
return target
}
// Clone function
func (m *DatadogConfig) Clone() proto.Message {
var target *DatadogConfig
if m == nil {
return target
}
target = &DatadogConfig{}
if h, ok := interface{}(m.GetServiceName()).(clone.Cloner); ok {
target.ServiceName = h.Clone().(*github_com_golang_protobuf_ptypes_wrappers.StringValue)
} else {
target.ServiceName = proto.Clone(m.GetServiceName()).(*github_com_golang_protobuf_ptypes_wrappers.StringValue)
}
target.CollectorHostname = m.GetCollectorHostname()
if h, ok := interface{}(m.GetRemoteConfig()).(clone.Cloner); ok {
target.RemoteConfig = h.Clone().(*DatadogRemoteConfig)
} else {
target.RemoteConfig = proto.Clone(m.GetRemoteConfig()).(*DatadogRemoteConfig)
}
switch m.CollectorCluster.(type) {
case *DatadogConfig_CollectorUpstreamRef:
if h, ok := interface{}(m.GetCollectorUpstreamRef()).(clone.Cloner); ok {
target.CollectorCluster = &DatadogConfig_CollectorUpstreamRef{
CollectorUpstreamRef: h.Clone().(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.ResourceRef),
}
} else {
target.CollectorCluster = &DatadogConfig_CollectorUpstreamRef{
CollectorUpstreamRef: proto.Clone(m.GetCollectorUpstreamRef()).(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.ResourceRef),
}
}
case *DatadogConfig_ClusterName:
target.CollectorCluster = &DatadogConfig_ClusterName{
ClusterName: m.GetClusterName(),
}
}
return target
}