interceptors

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	// Dispatch pushes a kernel event into interceptor chain. Interceptors are applied sequentially, so we have to make
	// sure that any interceptor providing additional context to the next interceptor is defined first in the chain. If
	// one interceptor fails, the next interceptor in chain is invoked.
	Dispatch(kevt *kevent.Kevent) (*kevent.Kevent, error)
	// Close closes the interceptor chain and frees all allocated resources.
	Close() error
}

Chain defines the method that all chan interceptors have to satisfy.

type InterceptorType

type InterceptorType uint8

InterceptorType is an alias for the interceptor type

const (
	// Ps represents the process interceptor.
	Ps InterceptorType = iota
	// Fs represents the file system interceptor.
	Fs
	// Registry represents the registry interceptor.
	Registry
	// Image represents the image interceptor.
	Image
	// Net represents the network interceptor.
	Net
	// Handle represents the handle interceptor.
	Handle
	// Driver represents the driver interceptor.
	Driver
)

func (InterceptorType) String

func (typ InterceptorType) String() string

String returns a human-friendly interceptor name.

type KstreamInterceptor

type KstreamInterceptor interface {
	// Intercept receives an existing kernel event possibly mutating its state. The event is filtered out if
	// this method returns an error. If it returns true, the next interceptor in the chain is evaluated.
	Intercept(kevt *kevent.Kevent) (*kevent.Kevent, bool, error)

	// Name returns a human-readable name of this interceptor.
	Name() InterceptorType

	// Close closes the interceptor and disposes allocated resources.
	Close()
}

KstreamInterceptor is the minimal interface that each kernel stream interceptor has to satisfy. Kernel stream interceptor has the ability to augment kernel event with additional parameters. It is also capable of building a state machine from the flow of kernel events going through it. The interceptor can also decide to drop the inbound kernel event by returning an error via its `Intercept` method.

Jump to

Keyboard shortcuts

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