livedebugging

package
v1.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

This service provides debug stream APIs for components.

Index

Constants

View Source
const ServiceName = "livedebugging"

ServiceName defines the name used for the livedebugging service.

Variables

This section is empty.

Functions

func NewLiveDebugging

func NewLiveDebugging() *liveDebugging

NewLiveDebugging creates a new instance of liveDebugging.

Types

type Arguments

type Arguments struct {
	Enabled bool `alloy:"enabled,attr,optional"`
}

type CallbackID

type CallbackID string

type CallbackManager

type CallbackManager interface {
	// AddCallback sets a callback for a given componentID.
	// The callback is used to send debugging data to live debugging consumers.
	AddCallback(callbackID CallbackID, componentID ComponentID, callback func(string)) error
	// DeleteCallback deletes a callback for a given componentID.
	DeleteCallback(callbackID CallbackID, componentID ComponentID)
}

CallbackManager is used to manage live debugging callbacks.

type ComponentID

type ComponentID string

type DebugDataPublisher

type DebugDataPublisher interface {
	// Publish sends debugging data for a given componentID.
	Publish(componentID ComponentID, data string)
	// IsActive returns true when at least one consumer is listening for debugging data for the given componentID.
	IsActive(componentID ComponentID) bool
}

DebugDataPublisher is used by components to push information to live debugging consumers.

type Service

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

func New

func New() *Service

func (*Service) Data

func (s *Service) Data() any

Data implements service.Service. It returns the liveDebugging for the components to stream.

func (*Service) Definition

func (*Service) Definition() service.Definition

Definition implements service.Service.

func (*Service) Run

func (s *Service) Run(ctx context.Context, host service.Host) error

Run implements service.Service.

func (*Service) Update

func (s *Service) Update(args any) error

Update implements service.Service.

Jump to

Keyboard shortcuts

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