model

package
v0.0.0-...-7279051 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType int32

EventType represents the type of the process lifecycle event

const (
	// Fork represents a process fork event
	Fork EventType = iota
	// Exec represents a process exec event
	Exec
	// Exit represents a process exit event
	Exit
)

func NewEventType

func NewEventType(eventType string) EventType

NewEventType returns the EventType associated with a string

func (*EventType) DecodeMsg

func (z *EventType) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (EventType) EncodeMsg

func (z EventType) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (EventType) MarshalMsg

func (z EventType) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (EventType) Msgsize

func (z EventType) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (EventType) String

func (e EventType) String() string

String returns the string representation of an EventType

func (*EventType) UnmarshalMsg

func (z *EventType) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ProcessEvent

type ProcessEvent struct {
	EventType      EventType `json:"event_type" msg:"event_type"`
	CollectionTime time.Time `json:"collection_time" msg:"collection_time"`
	Pid            uint32    `json:"pid" msg:"pid"`
	ContainerID    string    `json:"container_id" msg:"container_id"`
	Ppid           uint32    `json:"ppid" msg:"ppid"`
	UID            uint32    `json:"uid" msg:"uid"`
	GID            uint32    `json:"gid" msg:"gid"`
	Username       string    `json:"username" msg:"username"`
	Group          string    `json:"group" msg:"group"`
	Exe            string    `json:"exe" msg:"exe"`
	Cmdline        []string  `json:"cmdline" msg:"cmdline"`
	ForkTime       time.Time `json:"fork_time,omitempty" msg:"fork_time,omitempty"`
	ExecTime       time.Time `json:"exec_time,omitempty" msg:"exec_time,omitempty"`
	ExitTime       time.Time `json:"exit_time,omitempty" msg:"exit_time,omitempty"`
	ExitCode       uint32    `json:"exit_code,omitempty" msg:"exit_code,omitempty"`
}

ProcessEvent is a common interface for collected process events shared across multiple event listener implementations

func NewMockedExecEvent

func NewMockedExecEvent(ts time.Time, pid uint32, exe string, args []string) *ProcessEvent

NewMockedExecEvent creates a mocked Exec event for tests

func NewMockedExitEvent

func NewMockedExitEvent(ts time.Time, pid uint32, exe string, args []string, code uint32) *ProcessEvent

NewMockedExitEvent creates a mocked Exit event for tests

func NewMockedForkEvent

func NewMockedForkEvent(ts time.Time, pid uint32, exe string, args []string) *ProcessEvent

NewMockedForkEvent creates a mocked Fork event for tests

func (*ProcessEvent) DecodeMsg

func (z *ProcessEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ProcessEvent) EncodeMsg

func (z *ProcessEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ProcessEvent) MarshalMsg

func (z *ProcessEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ProcessEvent) Msgsize

func (z *ProcessEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ProcessEvent) UnmarshalMsg

func (z *ProcessEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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