forked from grafana/agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce service interface, port HTTP service (grafana#4320)
* service: introduce new service package The `service/` package is used to define Flow services, low-level constructs which run for the lifetime of the Flow controller. This commit introduces just the API for services, without using it anywhere. Related to grafana#4253. * pkg/flow: implement service.Host in Flow controller This commit updates the Flow controller to implement the new service.Host interface. Note that because it is not currently possible for a service or component to define a dependency on a service, the GetServiceConsumers method always returns nil. GetServiceConsumers will be updated in the future to return a non-nil list once it is possible for consumers of a service to exist. * service/http: port HTTP service to a service implementation This ports the HTTP service to implement the service.Service interface. The old HTTP service code has been removed in favor of the service. This required some hacks to wire everything in correctly; this will be cleaned up in the future once services are fully implemented.
- Loading branch information
Showing
4 changed files
with
400 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package flow | ||
|
||
// GetServiceConsumers implements [service.Host]. It returns a slice of | ||
// [component.Component] and [service.Service]s which declared a dependency on | ||
// the named service. | ||
func (f *Flow) GetServiceConsumers(serviceName string) []any { | ||
// TODO(rfratto): return non-nil once it is possible for a service or | ||
// component to declare a dependency on a named service. | ||
return nil | ||
} |
Oops, something went wrong.