forked from open-telemetry/opentelemetry-collector-contrib
/
common_test.go
39 lines (33 loc) · 1.05 KB
/
common_test.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
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package configschema
import (
"path/filepath"
"time"
"go.opentelemetry.io/collector/config/configtls"
)
type testPerson struct {
Name string
}
// testStruct comment
type testStruct struct {
One string `mapstructure:"one"`
Two int `mapstructure:"two"`
Three uint `mapstructure:"three"`
Four bool `mapstructure:"four"`
// embedded, package qualified comment
time.Duration `mapstructure:"duration"`
Squashed testPerson `mapstructure:",squash"`
PersonPtr *testPerson `mapstructure:"person_ptr"`
PersonStruct testPerson `mapstructure:"person_struct"`
Persons []testPerson `mapstructure:"persons"`
PersonPtrs []*testPerson `mapstructure:"person_ptrs"`
Ignored string `mapstructure:"-"`
TLS configtls.ClientConfig `mapstructure:"tls"`
}
func testDR() DirResolver {
return DirResolver{
SrcRoot: filepath.Join("..", ".."),
ModuleName: DefaultModule,
}
}