Debian Codegraph @

confmap/internal/confmap.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package internal // import "go.opentelemetry.io/collector/confmap/internal"
5
6 // Unmarshaler interface may be implemented by types to customize their behavior when being unmarshaled from a Conf.
7 // Only types with struct or pointer to struct kind are supported.
8 type Unmarshaler interface {
9 // Unmarshal a Conf into the struct in a custom way.
10 // The Conf for this specific component may be nil or empty if no config available.
11 // This method should only be called by decoding hooks when calling Conf.Unmarshal.
12 Unmarshal(component *Conf) error
13 }
14
15 // Marshaler defines an optional interface for custom configuration marshaling.
16 // A configuration struct can implement this interface to override the default
17 // marshaling.
18 type Marshaler interface {
19 // Marshal the config into a Conf in a custom way.
20 // The Conf will be empty and can be merged into.
21 Marshal(component *Conf) error
22 }