Documentation ¶
Index ¶
- Constants
- type Client
- type EventCommandsGetter
- type MessageBuilder
- type RecommendationFactory
- type Router
- func (r *Router) BuildTable(cfg *config.Config) *Router
- func (r *Router) HandleMappedEvent(ctx context.Context, s Source, targetEvent config.EventType, ...)
- func (r *Router) MapWithEventsInformer(srcEvent config.EventType, dstEvent config.EventType, ...) error
- func (r *Router) RegisterEventHandler(ctx context.Context, s Source, eventType config.EventType, ...)
- func (r *Router) RegisterInformers(targetEvents []config.EventType, handler registrationHandler) error
- type Source
Constants ¶
const (
// PluginName is the name of the Kubernetes Botkube plugin.
PluginName = "kubernetes"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client Kubernetes client
type EventCommandsGetter ¶
type MessageBuilder ¶
type MessageBuilder struct {
// contains filtered or unexported fields
}
func NewMessageBuilder ¶
func NewMessageBuilder(isInteractivitySupported bool, log logrus.FieldLogger, commandsGetter EventCommandsGetter) *MessageBuilder
func (*MessageBuilder) FromEvent ¶
func (m *MessageBuilder) FromEvent(event event.Event, actions []config.ExtraButtons) (api.Message, error)
type RecommendationFactory ¶
type RecommendationFactory interface {
New(cfg config.Config) (recommendation.AggregatedRunner, config.Recommendations)
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router maintains handled event types from registered informers
func NewRouter ¶
func NewRouter(mapper meta.RESTMapper, dynamicCli dynamic.Interface, log logrus.FieldLogger) *Router
NewRouter creates a new router to use for routing event types to registered informers.
func (*Router) BuildTable ¶
BuildTable builds the routers routing table marking it ready to register, map and handle informer events.
func (*Router) HandleMappedEvent ¶
func (r *Router) HandleMappedEvent(ctx context.Context, s Source, targetEvent config.EventType, handlerFn eventHandler)
HandleMappedEvent allows router clients to create handlers that are triggered for a target mapped event.
func (*Router) MapWithEventsInformer ¶
func (r *Router) MapWithEventsInformer(srcEvent config.EventType, dstEvent config.EventType, handler registrationHandler) error
MapWithEventsInformer allows resources to report on an event (srcEvent) that can only be observed by watching the general k8s v1/events resource using a different event (dstEvent).
For example, you can report the "error" EventType for a resource by having the router watch/interrogate the "warning" EventType reported by the v1/events resource.
func (*Router) RegisterEventHandler ¶
func (r *Router) RegisterEventHandler(ctx context.Context, s Source, eventType config.EventType, handlerFn func(ctx context.Context, s Source, e event.Event, updateDiffs []string))
RegisterEventHandler allows router clients to create handlers that are triggered for a target event.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source Kubernetes source plugin data structure
func (*Source) Stream ¶
func (*Source) Stream(ctx context.Context, input source.StreamInput) (source.StreamOutput, error)
Stream streams Kubernetes events