Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsReporter ¶ added in v0.13.0
type AnalyticsReporter interface {
// ReportHandledEventSuccess reports a successfully handled event using a given communication platform.
ReportHandledEventSuccess(integrationType config.IntegrationType, platform config.CommPlatformIntegration, eventDetails analytics.EventDetails) error
// ReportHandledEventError reports a failure while handling event using a given communication platform.
ReportHandledEventError(integrationType config.IntegrationType, platform config.CommPlatformIntegration, eventDetails analytics.EventDetails, err error) error
// ReportFatalError reports a fatal app error.
ReportFatalError(err error) error
// Close cleans up the reporter resources.
Close() error
}
AnalyticsReporter defines a reporter that collects analytics data.
type ConfigWatcher ¶ added in v0.13.0
type ConfigWatcher struct {
// contains filtered or unexported fields
}
ConfigWatcher watches for the config file changes and exits the app. TODO: It keeps the previous behavior for now, but it should hot-reload the configuration files without needing a restart.
func NewConfigWatcher ¶ added in v0.13.0
func NewConfigWatcher(log logrus.FieldLogger, configPaths []string, clusterName string, notifiers []Notifier) *ConfigWatcher
NewConfigWatcher returns new ConfigWatcher instance.
func (*ConfigWatcher) Do ¶ added in v0.13.0
func (w *ConfigWatcher) Do(ctx context.Context, cancelFunc context.CancelFunc) (err error)
Do starts watching the configuration file
type Controller ¶ added in v0.13.0
type Controller struct {
// contains filtered or unexported fields
}
Controller watches Kubernetes resources and send events to notifiers.
func New ¶ added in v0.13.0
func New(log logrus.FieldLogger, conf *config.Config, notifiers []Notifier, recommFactory RecommendationFactory, filterEngine filterengine.FilterEngine, dynamicCli dynamic.Interface, mapper meta.RESTMapper, informersResyncPeriod time.Duration, router *sources.Router, reporter AnalyticsReporter, ) *Controller
New create a new Controller instance.
type GitHubRepoClient ¶ added in v0.13.0
type GitHubRepoClient interface {
GetLatestRelease(ctx context.Context, owner, repo string) (*github.RepositoryRelease, *github.Response, error)
}
GitHubRepoClient describes the client for getting latest release for a given repository.
type Notifier ¶ added in v0.13.0
type Notifier interface {
// SendEvent notifies about new incoming event from source.
SendEvent(context.Context, events.Event, []string) error
// SendMessage is used for notifying about BotKube start/stop listening, possible BotKube upgrades and other events.
// Some integrations may decide to ignore such messages and have SendMessage method no-op.
// TODO: Consider option per channel to turn on/off "announcements" (BotKube start/stop/upgrade notify/config change.
SendMessage(context.Context, string) error
// IntegrationName returns a name of a given communication platform.
IntegrationName() config.CommPlatformIntegration
// Type returns a given integration type. See config.IntegrationType for possible integration types.
Type() config.IntegrationType
}
Notifier sends event notifications and messages on the communication channels.
type RecommendationFactory ¶ added in v0.13.0
type RecommendationFactory interface {
NewForSources(sources map[string]config.Sources, mapKeyOrder []string) (recommendation.AggregatedRunner, config.Recommendations)
}
RecommendationFactory defines a factory that creates recommendations.
type UpgradeChecker ¶ added in v0.13.0
type UpgradeChecker struct {
// contains filtered or unexported fields
}
UpgradeChecker checks for new BotKube releases.
func NewUpgradeChecker ¶ added in v0.13.0
func NewUpgradeChecker(log logrus.FieldLogger, notifiers []Notifier, ghCli GitHubRepoClient) *UpgradeChecker
NewUpgradeChecker creates a new instance of the Upgrade Checker.