Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidCheckInterval = errors.New("invalid check interval")
ErrInvalidCheckInterval is returned when the check interval is invalid
View Source
var ErrInvalidRegistrationInterval = errors.New("invalid registration interval")
ErrInvalidRegistrationInterval is returned when the registration interval is invalid
View Source
var ErrInvalidUnhealthyThreshold = errors.New("invalid unhealthy threshold")
ErrInvalidUnhealthyThreshold is returned when the unhealthy threshold is invalid
View Source
var ErrInvalidUpdateInterval = errors.New("invalid update interval")
ErrInvalidUpdateInterval is returned when the update interval is invalid
Functions ¶
func NewGitlabManager ¶
func NewGitlabManager(name string, gtmConfig TargetManagerConfig) *gitlabTargetManager
NewGitlabManager creates a new gitlabTargetManager
Types ¶
type Config ¶ added in v0.3.1
type Config struct { // The interval for the target reconciliation process CheckInterval time.Duration `yaml:"checkInterval" mapstructure:"checkInterval"` // How often the instance should register itself as a global target. // A duration of 0 means no registration. RegistrationInterval time.Duration `yaml:"registrationInterval" mapstructure:"registrationInterval"` // How often the instance should update its registration as a global target. // A duration of 0 means no update. UpdateInterval time.Duration `yaml:"updateInterval" mapstructure:"updateInterval"` // The amount of time a target can be unhealthy // before it is removed from the global target list. // A duration of 0 means no removal. UnhealthyThreshold time.Duration `yaml:"unhealthyThreshold" mapstructure:"unhealthyThreshold"` }
Config is the general configuration of the target manager
type GitlabTargetManagerConfig ¶ added in v0.3.1
type TargetManager ¶
type TargetManager interface { // Reconcile fetches the global targets from the configured // endpoint and updates the local state Reconcile(ctx context.Context) error // GetTargets returns the current global targets GetTargets() []checks.GlobalTarget // Shutdown shuts down the target manager // and unregisters the instance as a global target Shutdown(ctx context.Context) error }
TargetManager handles the management of globalTargets for a Sparrow instance
type TargetManagerConfig ¶ added in v0.3.1
type TargetManagerConfig struct { Config `yaml:",inline" mapstructure:",squash"` Gitlab GitlabTargetManagerConfig `yaml:"gitlab" mapstructure:"gitlab"` }
Click to show internal directories.
Click to hide internal directories.