service

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package service is package of service discovery module

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster added in v0.11.0

type Cluster struct {
	Name string `yaml:"name" json:"name,required"`
	// when Db is nil, iterate over all db's
	Db          *string `yaml:"db" json:"db"`
	ExcludeName *string `yaml:"exclude_name" json:"exclude_name"`
	ExcludeDb   *string `yaml:"exclude_db" json:"exclude_db"`
}

Cluster config filters

type Label added in v0.13.0

type Label struct {
	Name  string `yaml:"name" json:"name"`
	Value string `yaml:"value" json:"value"`
}

Label struct describe targets labels

type YandexConfig

type YandexConfig struct {
	AuthorizedKey   string    `json:"authorized_key" yaml:"authorized_key"`
	FolderID        string    `json:"folder_id" yaml:"folder_id"`
	User            string    `json:"user" yaml:"user"`
	Password        string    `json:"password" yaml:"password"` // #nosec G117
	PasswordFromEnv string    `json:"password_from_env" yaml:"password_from_env"`
	RefreshInterval int       `json:"refresh_interval" yaml:"refresh_interval"`
	Clusters        []Cluster `json:"clusters" yaml:"clusters"`
	TargetLabels    *[]Label  `json:"target_labels" yaml:"target_labels"`
}

YandexConfig AuthorizedKey - path to json file, Password - password for databases, Clusters - array of structures with matching rules

type YandexDiscovery

type YandexDiscovery struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

YandexDiscovery is main struct for Yandex Managed Databases discoverer

func NewYandexDiscovery added in v0.11.0

func NewYandexDiscovery() *YandexDiscovery

NewYandexDiscovery return pointer initialized YandexDiscovery structure

func (*YandexDiscovery) Init

func (yd *YandexDiscovery) Init(cfg discovery.Config) error

Init implementation Init method of Discovery interface

func (*YandexDiscovery) Start

func (yd *YandexDiscovery) Start(ctx context.Context, errCh chan<- error) error

Start implementation Start method of Discovery interface

func (*YandexDiscovery) Subscribe

func (yd *YandexDiscovery) Subscribe(subscriberID string, addService discovery.AddServiceFunc, removeService discovery.RemoveServiceFunc) error

Subscribe implementation Subscribe method of Discovery interface

func (*YandexDiscovery) Sync

func (yd *YandexDiscovery) Sync() error

Sync implementation Sync method of Discovery interface

func (*YandexDiscovery) Unsubscribe

func (yd *YandexDiscovery) Unsubscribe(subscriberID string) error

Unsubscribe implementation Unsubscribe method of Discovery interface

Jump to

Keyboard shortcuts

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