Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EventsMap = map[EventName]*EventSchema{ "ExampleEvent": { Name: "ExampleEvent", Reason: "ExampleEvent", Action: "ExampleEvent", Type: EventTypeWarning, ReportingController: "controller", Message: "ExampleEvent message.", }, }
Functions ¶
func GetEventKey ¶ added in v0.1.8
getEventKey builds unique event key based on source, involvedObject, reason, message
func IsEventDisabled ¶ added in v0.1.0
Types ¶
type Event ¶
type Event struct { // Object is the reference of the k8s object which this event corresponds to Object runtime.Object // RelatedObject is the ref to related object (optional) RelatedObject runtime.Object // ReportingInstance is the name of the reporting instance ReportingInstance string // Name is the name of the event to be looked up in event schema Name EventName }
type EventConfig ¶ added in v0.1.0
type EventConfig struct {
DisabledEvents []string
}
type EventName ¶ added in v0.1.0
type EventName string
var (
EventExampleEvent EventName = "ExampleEvent"
)
type EventRecorder ¶
type EventRecorder interface { // RecordEvent is used to record a new event RecordEvent(context.Context, *Event) error // WithSlice returns a new recorder with slice name added WithSlice(string) EventRecorder // WithNamespace returns a new recorder with namespace name added WithNamespace(string) EventRecorder // WithProject returns a new recorder with project name added WithProject(string) EventRecorder }
EventRecorder is used to record events from a component
func NewEventRecorder ¶ added in v0.1.0
func NewEventRecorder(c client.Writer, s *runtime.Scheme, em map[EventName]*EventSchema, o EventRecorderOptions) EventRecorder
type EventRecorderOptions ¶ added in v0.1.0
type EventRecorderOptions struct { // Version is the version of the component Version string // Cluster is the name of the cluster Cluster string // Project is the name of the project Project string // Slice is the name of the slice (optional) Slice string // Namespace is the namespace this event recorder corresponds to (optional) Namespace string // Component is the component which uses the event recorder Component string }
type EventSchema ¶ added in v0.1.0
type EventSchema struct { Name EventName Reason string Action string Type EventType ReportingController string `yaml:"reportingController"` Message string }
func GetEvent ¶ added in v0.1.0
func GetEvent(name EventName, eventsMap map[EventName]*EventSchema) (*EventSchema, error)
Click to show internal directories.
Click to hide internal directories.