apmconfig

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package apmconfig provides an API for watching agent config changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	// Err holds an error that occurred while querying agent config.
	Err error

	// Attrs holds the agent's configuration. May be empty.
	Attrs map[string]string
}

Change holds an agent configuration change: an error or the new config attributes.

type WatchParams

type WatchParams struct {
	// Service holds the name and optionally environment name used
	// for filtering the config to watch.
	Service struct {
		Name        string
		Environment string
	}
}

WatchParams holds parameters for watching for config changes.

type Watcher

type Watcher interface {
	// WatchConfig subscribes to changes to configuration for the agent,
	// which must match the given ConfigSelector.
	//
	// If the watcher experiences an unexpected error fetching config,
	// it will surface this in a Change with the Err field set.
	//
	// If the provided context is cancelled, or the watcher experiences
	// a fatal condition, the returned channel will be closed.
	WatchConfig(context.Context, WatchParams) <-chan Change
}

Watcher provides an interface for watching config changes.

Jump to

Keyboard shortcuts

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