eventbus

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeNoSubscriber = "NoSubscriber"
	ErrTypeBufferFull   = "BufferFull"

	MetricNameEventBusErr = "event_bus_err"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEvent

type BaseEvent interface {
	// contains filtered or unexported methods
}

type BaseEventImpl

type BaseEventImpl struct {
	Time time.Time
}

type ConsumeFunc

type ConsumeFunc func(interface{}) error

type EventBus

type EventBus interface {
	Publish(topic string, event interface{}) error
	Subscribe(topic string, subscriber string, bufferSize int, handler ConsumeFunc) error
	EnableStatistic()
	SetEmitter(emitter metrics.MetricEmitter)
}

EventBus TODO: support event type check, unsubscribe, stop, statistics

func GetDefaultEventBus

func GetDefaultEventBus() EventBus

func NewEventBus

func NewEventBus(bufferSize int) EventBus

type RawCGroupEvent

type RawCGroupEvent struct {
	BaseEventImpl
	Cost       time.Duration
	CGroupPath string
	CGroupFile string
	Data       string
	OldData    string
}

type SyscallEvent

type SyscallEvent struct {
	BaseEventImpl
	Cost        time.Duration
	Syscall     string
	PodUID      string
	ContainerID string
	Logs        []SyscallLog
}

type SyscallLog

type SyscallLog struct {
	Time     time.Time
	KeyValue map[string]string
}

Jump to

Keyboard shortcuts

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