discovery

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveryService

type DiscoveryService interface {
	// ListServices returns the names of all registered services.
	ListServices(ctx context.Context) ([]string, error)

	// DiscoverWithTags discovers service instances matching name + tags.
	DiscoverWithTags(ctx context.Context, serviceName string, tags []string) ([]*ServiceInstance, error)
}

DiscoveryService is the interface the dashboard needs from a discovery service. This decouples the dashboard from the discovery extension's separate Go module, allowing the integration to work with any discovery provider that satisfies this contract. The forge extensions/discovery.Service type satisfies this interface.

type Integration

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

Integration watches a discovery service for services tagged as dashboard contributors and automatically registers/unregisters them.

func NewIntegration

func NewIntegration(
	discovery DiscoveryService,
	registry *contributor.ContributorRegistry,
	tag string,
	pollInterval time.Duration,
	proxyTimeout time.Duration,
	logger forge.Logger,
) *Integration

NewIntegration creates a new discovery integration.

func (*Integration) Start

func (i *Integration) Start(ctx context.Context)

Start begins polling the discovery service for dashboard contributors.

func (*Integration) Stop

func (i *Integration) Stop()

Stop stops the discovery integration.

func (*Integration) TrackedCount

func (i *Integration) TrackedCount() int

TrackedCount returns the number of tracked remote contributors.

type ServiceInstance

type ServiceInstance struct {
	ID       string
	Name     string
	Address  string
	Port     int
	Tags     []string
	Metadata map[string]string
	Status   string // "passing", "warning", "critical", "unknown"
}

ServiceInstance mirrors the minimal fields the dashboard needs from a discovered service. This matches discovery/backends.ServiceInstance without importing the external module.

func (*ServiceInstance) GetMetadata

func (si *ServiceInstance) GetMetadata(key string) (string, bool)

GetMetadata retrieves metadata by key.

func (*ServiceInstance) IsHealthy

func (si *ServiceInstance) IsHealthy() bool

IsHealthy returns true if the service status is "passing".

func (*ServiceInstance) URL

func (si *ServiceInstance) URL(scheme string) string

URL returns the full URL for the service instance.

Jump to

Keyboard shortcuts

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