Documentation
¶
Overview ¶
Package service is package of service discovery module
Index ¶
- type Cluster
- type Label
- type YandexConfig
- type YandexDiscovery
- func (yd *YandexDiscovery) Init(cfg discovery.Config) error
- func (yd *YandexDiscovery) Start(ctx context.Context, errCh chan<- error) error
- func (yd *YandexDiscovery) Subscribe(subscriberID string, addService discovery.AddServiceFunc, ...) error
- func (yd *YandexDiscovery) Sync() error
- func (yd *YandexDiscovery) Unsubscribe(subscriberID string) error
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 ¶
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