common_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package configschema
  4. import (
  5. "path/filepath"
  6. "time"
  7. "go.opentelemetry.io/collector/config/configtls"
  8. )
  9. type testPerson struct {
  10. Name string
  11. }
  12. // testStruct comment
  13. type testStruct struct {
  14. One string `mapstructure:"one"`
  15. Two int `mapstructure:"two"`
  16. Three uint `mapstructure:"three"`
  17. Four bool `mapstructure:"four"`
  18. // embedded, package qualified comment
  19. time.Duration `mapstructure:"duration"`
  20. Squashed testPerson `mapstructure:",squash"`
  21. PersonPtr *testPerson `mapstructure:"person_ptr"`
  22. PersonStruct testPerson `mapstructure:"person_struct"`
  23. Persons []testPerson `mapstructure:"persons"`
  24. PersonPtrs []*testPerson `mapstructure:"person_ptrs"`
  25. Ignored string `mapstructure:"-"`
  26. TLS configtls.TLSClientSetting `mapstructure:"tls"`
  27. }
  28. func testDR() DirResolver {
  29. return DirResolver{
  30. SrcRoot: filepath.Join("..", ".."),
  31. ModuleName: DefaultModule,
  32. }
  33. }