protocol

package
v0.0.0-...-e75737a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package protocol includes the "API" of events the rule-engine can consume. All producers who intend to add support for tracker need to support this protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Headers EventHeaders
	Payload interface{}
}

Event is a generic event that the Engine can process

func (*Event) Header

func (e *Event) Header(header string) string

Get a custom header that was set through SetHeader

func (*Event) Selector

func (e *Event) Selector() Selector

Get Event's Selector

func (*Event) SetHeader

func (e *Event) SetHeader(header string, value string)

Set a custom header

type EventHeaders

type EventHeaders struct {
	// Selector is a propriotary header used for filtering event subscriptions in the engin
	Selector Selector
	// contains filtered or unexported fields
}

EventHeaders are headers attached to the Event struct, used to send metadata about the payload

type Selector

type Selector struct {
	// Name indicates the name of the Event payload
	Name string
	// Origin indicates where the event was generated (host, container, pod), this may be empty depending on Source
	Origin string
	// Source indicates the producer of the Event (example: tracker, CNDR, K8SAuditLog...)
	Source string
}

Selector is a propriotary header used for filtering event subscriptions in the engine

Jump to

Keyboard shortcuts

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