Documentation
¶
Index ¶
- type Config
- type HandlerOverride
- type Manager
- func (m *Manager) DeleteGlobalField(ctx context.Context, field string) error
- func (m *Manager) DeleteHandler(ctx context.Context, taskType string) error
- func (m *Manager) Get() *Snapshot
- func (m *Manager) GetAllGlobal(ctx context.Context) (map[string]string, error)
- func (m *Manager) GetAllHandler(ctx context.Context, taskType string) (map[string]string, error)
- func (m *Manager) GetHandler(taskType string) (HandlerOverride, bool)
- func (m *Manager) SetGlobal(ctx context.Context, field, value string) error
- func (m *Manager) SetHandler(ctx context.Context, taskType, field, value string) error
- func (m *Manager) Start(ctx context.Context)
- func (m *Manager) Stop()
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RDB rueidis.Client
Prefix string
PollInterval time.Duration // Default: 10s.
Logger gochainedlog.Logger
}
Config holds manager configuration.
type HandlerOverride ¶
type HandlerOverride struct {
Concurrency int `json:"concurrency,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
MaxAttempts int `json:"max_attempts,omitempty"`
}
HandlerOverride holds per-handler dynamic settings.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager polls Redis for configuration changes and maintains an atomic snapshot.
func NewManager ¶
NewManager creates a new dynamic configuration manager.
func (*Manager) DeleteGlobalField ¶
DeleteGlobalField deletes a global config field.
func (*Manager) DeleteHandler ¶
DeleteHandler deletes all overrides for a task type.
func (*Manager) GetAllGlobal ¶
GetAllGlobal returns all global config fields.
func (*Manager) GetAllHandler ¶
GetAllHandler returns all config fields for a task type.
func (*Manager) GetHandler ¶
func (m *Manager) GetHandler(taskType string) (HandlerOverride, bool)
GetHandler returns the handler override for a task type, if any.
func (*Manager) SetHandler ¶
SetHandler sets a handler config field for a specific task type.
type Snapshot ¶
type Snapshot struct {
// Global settings.
MaxConcurrency int `json:"max_concurrency,omitempty"`
SchedulerTickInterval time.Duration `json:"scheduler_tick_interval,omitempty"`
// Per-handler overrides (keyed by task type).
Handlers map[string]HandlerOverride `json:"handlers,omitempty"`
}
Snapshot holds a point-in-time view of dynamic configuration.
Click to show internal directories.
Click to hide internal directories.