Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupported = errors.New("AD: variable not supported by listener")
ErrNotSupported is thrown if listener doesn't support the asked variable
var ServiceListenerFactories = make(map[string]ServiceListenerFactory)
ServiceListenerFactories holds the registered factories
Functions ¶
func ComputeContainerServiceIDs ¶
ComputeContainerServiceIDs takes a container ID, an image (resolved to an actual name) and labels and computes the service IDs for this container service.
func Register ¶
func Register(name string, factory ServiceListenerFactory)
Register registers a service listener factory
Types ¶
type Service ¶
type Service interface { GetID() ID // unique ID GetADIdentifiers() ([]string, error) // identifiers on which templates will be matched GetHosts() (map[string]string, error) // network --> IP address GetPorts() ([]int, error) // network ports GetTags() ([]string, error) // tags GetPid() (int, error) // process identifier }
Service represents an application we can run a check against. It should be matched with a check template by the ConfigResolver using the ADIdentifiers field.
type ServiceListener ¶
type ServiceListener interface { Listen(newSvc, delSvc chan<- Service) Stop() }
ServiceListener monitors running services and triggers check (un)scheduling
It holds a cache of running services, listens to new/killed services and updates its cache, and the ConfigResolver with these events.
type ServiceListenerFactory ¶
type ServiceListenerFactory func() (ServiceListener, error)
ServiceListenerFactory builds a service listener