examples

package
v0.0.0-...-459aa24 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package examples provides an example of how to use the event monitor module using a basic consumer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleEvent

type SimpleEvent struct {
	Type         uint32   `copy:"GetEventType;event:*;cast:uint32"`
	ExecFilePath string   `copy:"GetExecFilePath;event:ExecEventType"`
	Envp         []string `copy:"GetProcessEnvp;event:ExecEventType"`
}

SimpleEvent defines a simple event

type SimpleEventConsumer

type SimpleEventConsumer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SimpleEventConsumer defines a simple event consumer

func NewSimpleEventConsumer

func NewSimpleEventConsumer(em *eventmonitor.EventMonitor) *SimpleEventConsumer

NewSimpleEventConsumer returns a new simple event consumer

func (*SimpleEventConsumer) AddHandler

func (fc *SimpleEventConsumer) AddHandler(handler func(evt *SimpleEvent))

AddHandler adds a handler to this consumer

func (*SimpleEventConsumer) ChanSize

func (fc *SimpleEventConsumer) ChanSize() int

ChanSize returns the chan size used by the consumer

func (*SimpleEventConsumer) Copy

func (fc *SimpleEventConsumer) Copy(event *smodel.Event) any

func (*SimpleEventConsumer) EventTypes

func (fc *SimpleEventConsumer) EventTypes() []model.EventType

EventTypes returns the event types handled by this consumer Implement the consumer interface

func (*SimpleEventConsumer) ExecCount

func (fc *SimpleEventConsumer) ExecCount() int

ExecCount returns the number of exec handled

func (*SimpleEventConsumer) ExitCount

func (fc *SimpleEventConsumer) ExitCount() int

ExitCount returns the number of exit handled

func (*SimpleEventConsumer) ForkCount

func (fc *SimpleEventConsumer) ForkCount() int

ForkCount returns the number of fork handled

func (*SimpleEventConsumer) HandleEvent

func (fc *SimpleEventConsumer) HandleEvent(event any)

HandleEvent handles this event Implement the consumer interface

func (*SimpleEventConsumer) ID

func (fc *SimpleEventConsumer) ID() string

ID returns the ID of this consumer Implement the consumer interface

func (*SimpleEventConsumer) Start

func (fc *SimpleEventConsumer) Start() error

Start the consumer Implement the consumer interface

func (*SimpleEventConsumer) Stop

func (fc *SimpleEventConsumer) Stop()

Stop the consumer Implement the consumer interface

Jump to

Keyboard shortcuts

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