service

package
v1.59.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package service provides a service wrapper around the collector regardless of managed or standalone mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunService

func RunService(logger *zap.Logger, rSvc RunnableService) error

RunService runs the given service, calling its start and stop functions.

Types

type ManagedCollectorService

type ManagedCollectorService struct {
	// contains filtered or unexported fields
}

ManagedCollectorService is a RunnableService that runs the collector being managed by an OpAmp enabled platform

func NewManagedCollectorService

func NewManagedCollectorService(col collector.Collector, logger *zap.Logger, managerConfigPath, collectorConfigPath, loggerConfigPath string) (*ManagedCollectorService, error)

NewManagedCollectorService creates a new ManagedCollectorService

func (*ManagedCollectorService) Error

func (m *ManagedCollectorService) Error() <-chan error

Error returns an empty error channel. This will never send errors.

func (*ManagedCollectorService) Start

Start initiates the OpAmp connection and starts the collector

func (*ManagedCollectorService) Stop

Stop stops the collector and disconnects from the platform

type RunnableService

type RunnableService interface {
	// Start asynchronously starts the underlying service. The service may not necessarily be "ready"
	// once this returns, but could be asynchronously starting up.
	Start(ctx context.Context) error
	// Stop synchronously shuts down the service. After this function returns, the underlying service should be completely stopped.
	Stop(ctx context.Context) error
	// Error returns an error channel that should emit an error when the service must unexpectedly quit.
	Error() <-chan error
}

RunnableService may be run as a service.

type StandaloneCollectorService

type StandaloneCollectorService struct {
	// contains filtered or unexported fields
}

StandaloneCollectorService is a RunnableService that runs the collector in standalone mode.

func NewStandaloneCollectorService

func NewStandaloneCollectorService(c collector.Collector) StandaloneCollectorService

NewStandaloneCollectorService creates a new StandaloneCollectorService

func (StandaloneCollectorService) Error

func (s StandaloneCollectorService) Error() <-chan error

Error returns a channel that can emit asynchronous, unrecoverable errors

func (StandaloneCollectorService) Start

Start starts the collector

func (StandaloneCollectorService) Stop

Stop shuts down the underlying collector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL