sinks

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventData

type EventData struct {
	Verb     string    `json:"verb"`
	Event    *v1.Event `json:"event"`
	OldEvent *v1.Event `json:"old_event,omitempty"`
}

EventData encodes an eventrouter event and previous event, with a verb for whether the event is created or updated.

func NewEventData

func NewEventData(eNew *v1.Event, eOld *v1.Event) EventData

NewEventData constructs an EventData struct from an old and new event, setting the verb accordingly

func (*EventData) WriteFlattenedJSON

func (e *EventData) WriteFlattenedJSON(w io.Writer) (int64, error)

WriteFlattenedJSON writes the json to the file in the below format 1) Flattens the json into a not nested key:value 2) Convert the json into snake format Eg: {"event_involved_object_kind":"pod", "event_metadata_namespace":"kube-system"}

func (*EventData) WriteRFC5424

func (e *EventData) WriteRFC5424(w io.Writer) (int64, error)

WriteRFC5424 writes the current event data to the given io.Writer using RFC5424 (syslog over TCP) syntax.

type EventSinkInterface

type EventSinkInterface interface {
	UpdateEvents(eNew *v1.Event, eOld *v1.Event)
}

EventSinkInterface is the interface used to shunt events

func ManufactureSink

func ManufactureSink() (e EventSinkInterface)

ManufactureSink will manufacture a sink according to viper configs TODO: Determine if it should return an array of sinks

func NewStdoutSink

func NewStdoutSink(namespace string) EventSinkInterface

NewStdoutSink will create a new StdoutSink with default options, returned as an EventSinkInterface

type StdoutSink

type StdoutSink struct {
	// contains filtered or unexported fields
}

StdoutSink is the other basic sink By default, Fluentd/ElasticSearch won't index glog formatted lines By logging raw JSON to stdout, we will get automated indexing which can be queried in Kibana.

func (*StdoutSink) UpdateEvents

func (gs *StdoutSink) UpdateEvents(eNew *v1.Event, eOld *v1.Event)

UpdateEvents implements the EventSinkInterface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL