| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package testcomponents // import "go.opentelemetry.io/collector/service/internal/testcomponents" |
| 5 |
|
| 6 |
import ( |
| 7 |
"context" |
| 8 |
|
| 9 |
"go.opentelemetry.io/collector/component" |
| 10 |
) |
| 11 |
|
| 12 |
type componentState struct { |
| 13 |
started bool |
| 14 |
stopped bool |
| 15 |
} |
| 16 |
|
| 17 |
func (cs *componentState) Started() bool { |
| 18 |
return cs.started |
| 19 |
} |
| 20 |
|
| 21 |
func (cs *componentState) Stopped() bool { |
| 22 |
return cs.stopped |
| 23 |
} |
| 24 |
|
| 25 |
func (cs *componentState) Start(context.Context, component.Host) error { |
| 26 |
cs.started = true |
| 27 |
return nil |
| 28 |
} |
| 29 |
|
| 30 |
func (cs *componentState) Shutdown(context.Context) error { |
| 31 |
cs.stopped = true |
| 32 |
return nil |
| 33 |
} |