@@ -24,33 +24,8 @@ import (
24
24
"go.opentelemetry.io/collector/config"
25
25
"go.opentelemetry.io/collector/consumer/consumererror"
26
26
"go.opentelemetry.io/collector/service/internal/builder"
27
- "go.opentelemetry.io/collector/service/parserprovider"
28
27
)
29
28
30
- // settings holds configuration for building a new service.
31
- type Settings struct {
32
- // Factories component factories.
33
- Factories component.Factories
34
-
35
- // ComponentSettings contains logger and build info configuration
36
- ComponentSettings component.ComponentSettings
37
-
38
- // Config represents the configuration of the service.
39
- Config * config.Config
40
-
41
- // ParserProvider provides the configuration's Parser.
42
- // If it is not provided a default provider is used. The default provider loads the configuration
43
- // from a config file define by the --config command line flag and overrides component's configuration
44
- // properties supplied via --set command line flag.
45
- ParserProvider parserprovider.ParserProvider
46
-
47
- // LoggingOptions provides a way to change behavior of zap logging.
48
- LoggingOptions []zap.Option
49
-
50
- // AsyncErrorChannel is the channel that is used to report fatal errors.
51
- AsyncErrorChannel chan error
52
- }
53
-
54
29
// service represents the implementation of a component.Host.
55
30
type service struct {
56
31
factories component.Factories
@@ -65,13 +40,13 @@ type service struct {
65
40
builtExtensions builder.Extensions
66
41
}
67
42
68
- func newService (settings * Settings ) (* service , error ) {
43
+ func newService (set * ServiceSettings ) (* service , error ) {
69
44
srv := & service {
70
- factories : settings .Factories ,
71
- buildInfo : settings . ComponentSettings .BuildInfo ,
72
- config : settings .Config ,
73
- logger : settings . ComponentSettings .Logger ,
74
- asyncErrorChannel : settings .AsyncErrorChannel ,
45
+ factories : set . CommonSettings .Factories ,
46
+ buildInfo : set . CommonSettings .BuildInfo ,
47
+ config : set .Config ,
48
+ logger : set .Logger ,
49
+ asyncErrorChannel : set .AsyncErrorChannel ,
75
50
}
76
51
77
52
if err := srv .config .Validate (); err != nil {
0 commit comments