discovery

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package discovery is main package of service discovery module

Index

Constants

View Source
const (
	// YandexMDB constant SdConfig.type
	YandexMDB = "yandex-mdb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddServiceFunc

type AddServiceFunc func(services map[string]Service) error

AddServiceFunc services arg is map serviceId -> data source name

type Config

type Config any

Config abstract configuration SdConfig.config

type Discovery

type Discovery interface {
	//Init casting abstract Config to determined structure
	Init(c Config) error
	//Start is the discoverer starting point
	Start(ctx context.Context, errCh chan<- error) error
	//Subscribe - binding "add" and "remove" functions. Functions will be called when services appear or disappear
	Subscribe(subscriberID string, addService AddServiceFunc, removeService RemoveServiceFunc) error
	//Unsubscribe - remove subscriber from list
	Unsubscribe(subscriberID string) error
}

Discovery interface of abstract discovery services

type RemoveServiceFunc

type RemoveServiceFunc func(serviceIds []string) error

RemoveServiceFunc serviceIds is array of service IDs

type SdConfig

type SdConfig struct {
	Type   string `yaml:"type"`
	Config Config `yaml:"config"`
}

SdConfig top level of configuration tree

type Service

type Service struct {
	DSN          string
	ConstLabels  map[string]string
	TargetLabels map[string]string
}

Service abstract service definition

Directories

Path Synopsis
Package factory create service discovery from config
Package factory create service discovery from config
Package log using for logging SD event
Package log using for logging SD event

Jump to

Keyboard shortcuts

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