integrations

package
v0.0.0-...-cdf0a0a Latest Latest
Warning

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

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

Documentation

Overview

Package integrations adds a go interface for integrations to register and send logs.

The integrations component is a basic interface for integrations to send logs from one place to another. Integrations and their configs can be registered using the RegisterIntegrations function and then use the SendLog function to send logs to consumers, who will use the SubscribeIntegration and Subscribe functions to receive integration configs and logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	// RegisterIntegration registers an integration with the component.
	RegisterIntegration(id string, config integration.Config)

	// SubscribeIntegration returns a channel for a subscriber to receive integration configurations.
	SubscribeIntegration() chan IntegrationConfig

	// Subscribe subscribes returns a channel for a subscriber to receive logs from integrations.
	Subscribe() chan IntegrationLog

	// SendLog allows integrations to send logs to any subscribers.
	SendLog(log, integrationID string)
}

Component is the component type.

type IntegrationConfig

type IntegrationConfig struct {
	IntegrationID string
	Config        integration.Config
}

IntegrationConfig represents the combined ID and Config for an integration

type IntegrationLog

type IntegrationLog struct {
	Log           string
	IntegrationID string
}

IntegrationLog represents the combined Log and IntegrationID for the integration sending the log

Jump to

Keyboard shortcuts

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