Documentation
¶
Overview ¶
Package etcd implements the provider.Provider interface for etcd configuration backends. It uses etcd's native Watch API with prefix-based watching for efficient event-driven dynamic configuration updates. A single watch call monitors all keys under a common prefix.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Endpoints []string // etcd endpoints, e.g. []string{"localhost:2379"}
DialTimeout time.Duration // timeout for establishing connection
}
Config holds etcd-specific configuration.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the poya Provider interface using etcd's native Watch API.
func (*Provider) Watch ¶
func (p *Provider) Watch(ctx context.Context, keys []string, onChange func(key string, value string)) error
Watch monitors all keys under a common prefix using a single etcd Watch call. It extracts the longest common prefix from the provided keys, watches that prefix, and calls onChange for each key that changes.
Click to show internal directories.
Click to hide internal directories.