Documentation ¶
Overview ¶
Package events implements the eventing framework to receive and relay kubernetes events, and a framework to publish events to the Kubernetes API server.
Index ¶
- Constants
- type EventRecorder
- func (e *EventRecorder) ErrorEvent(err error, reason string, messageFmt string, args ...interface{})
- func (e *EventRecorder) FatalEvent(err error, reason string, messageFmt string, args ...interface{})
- func (e *EventRecorder) Initialize(object runtime.Object, kubeClient kubernetes.Interface, namespace string) error
- func (e *EventRecorder) NormalEvent(reason string, messageFmt string, args ...interface{})
- func (e *EventRecorder) WarnEvent(reason string, messageFmt string, args ...interface{})
- type PubSub
- type PubSubMessage
Constants ¶
const ( // InvalidCLIParameters signifies invalid CLI parameters InvalidCLIParameters = "FatalInvalidCLIParameters" // InitializationError signifies an error during initialization InitializationError = "FatalInitializationError" // InvalidCertificateManager signifies that the certificate manager is invalid InvalidCertificateManager = "FatalInvalidCertificateManager" // CertificateIssuanceFailure signifies that a request to issue a certificate failed CertificateIssuanceFailure = "FatalCertificateIssuanceFailure" )
Kubernetes Fatal Event reasons Fatal events are prefixed with 'Fatal' to help the event recording framework to wait for fatal events to be recorded prior to aborting.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRecorder ¶
type EventRecorder struct {
// contains filtered or unexported fields
}
EventRecorder is a type used to record Kubernetes events
func GenericEventRecorder ¶
func GenericEventRecorder() *EventRecorder
GenericEventRecorder is a singleton that returns a generic EventRecorder type. The EventRecorder returned needs to be explicitly initialized by calling the 'Initialize' method on the object
func NewEventRecorder ¶
func NewEventRecorder(object runtime.Object, kubeClient kubernetes.Interface, namespace string) (*EventRecorder, error)
NewEventRecorder returns a new EventRecorder object and an error in case of errors
func (*EventRecorder) ErrorEvent ¶
func (e *EventRecorder) ErrorEvent(err error, reason string, messageFmt string, args ...interface{})
ErrorEvent records a Warning Kubernetes event
func (*EventRecorder) FatalEvent ¶
func (e *EventRecorder) FatalEvent(err error, reason string, messageFmt string, args ...interface{})
FatalEvent records a Warning Kubernetes event
func (*EventRecorder) Initialize ¶
func (e *EventRecorder) Initialize(object runtime.Object, kubeClient kubernetes.Interface, namespace string) error
Initialize initializes an uninitialized EventRecorder object
func (*EventRecorder) NormalEvent ¶
func (e *EventRecorder) NormalEvent(reason string, messageFmt string, args ...interface{})
NormalEvent records a Normal Kubernetes event
func (*EventRecorder) WarnEvent ¶
func (e *EventRecorder) WarnEvent(reason string, messageFmt string, args ...interface{})
WarnEvent records a Warning Kubernetes event
type PubSub ¶ added in v0.6.0
type PubSub interface { // Subscribe returns a channel subscribed to the specific type/s of announcement/s passed by parameter Subscribe(aTypes ...announcements.AnnouncementType) chan interface{} // Publish publishes the message to all subscribers that have subscribed to <message.AnnouncementType> topic Publish(message PubSubMessage) // Unsub unsubscribes and closes the channel on pubsub backend // Note this is a necessary step to ensure a channel can be // garbage collected when it is freed. Unsub(unsubChan chan interface{}) }
PubSub is a simple interface to call for pubsub functionality in front of a pubsub implementation
func GetPubSubInstance ¶ added in v0.6.0
func GetPubSubInstance() PubSub
GetPubSubInstance returns a unique, global scope PubSub interface instance Note that spawning the instance is not thread-safe. First call should happen on a single-routine context to avoid races.
type PubSubMessage ¶ added in v0.6.0
type PubSubMessage struct { AnnouncementType announcements.AnnouncementType OldObj interface{} NewObj interface{} }
PubSubMessage represents a common messages abstraction to pass through the PubSub interface