observeroption

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = Options{
	MaxFlows:      container.Capacity4095,
	MonitorBuffer: 1024,
}

Default serves only as reference point for default values. Very useful for the CLI to pick these up instead of defining own defaults that need to be kept in sync.

Functions

This section is empty.

Types

type CiliumDaemon

type CiliumDaemon interface {
	DebugEnabled() bool
	// CiliumDaemon implements the StoreGetter interface that exposes cached stores
	// of various k8s resources.
	// WARNING: Access to the stores are meant to be read-only. Do not modify the stores
	// or any objects returned by the stores.
	getters.StoreGetter
}

CiliumDaemon is a reference to the Cilium's Daemon when running inside Cilium

type OnDecodedEvent

type OnDecodedEvent interface {
	OnDecodedEvent(context.Context, *v1.Event) (stop, error)
}

OnDecodedEvent is invoked after an event has been decoded

type OnDecodedEventFunc

type OnDecodedEventFunc func(context.Context, *v1.Event) (stop, error)

OnDecodedEventFunc implements OnDecodedEvent for a single function

func (OnDecodedEventFunc) OnDecodedEvent

func (f OnDecodedEventFunc) OnDecodedEvent(ctx context.Context, event *v1.Event) (stop, error)

OnDecodedEvent is invoked after a flow has been decoded

type OnDecodedFlow

type OnDecodedFlow interface {
	OnDecodedFlow(context.Context, *pb.Flow) (stop, error)
}

OnDecodedFlow is invoked after a flow has been decoded

type OnDecodedFlowFunc

type OnDecodedFlowFunc func(context.Context, *pb.Flow) (stop, error)

OnDecodedFlowFunc implements OnDecodedFlow for a single function

func (OnDecodedFlowFunc) OnDecodedFlow

func (f OnDecodedFlowFunc) OnDecodedFlow(ctx context.Context, flow *pb.Flow) (stop, error)

OnDecodedFlow is invoked after a flow has been decoded

type OnFlowDelivery

type OnFlowDelivery interface {
	OnFlowDelivery(context.Context, *pb.Flow) (stop, error)
}

OnFlowDelivery is invoked before a flow is delivered via the API

type OnFlowDeliveryFunc

type OnFlowDeliveryFunc func(context.Context, *pb.Flow) (stop, error)

OnFlowDeliveryFunc implements OnFlowDelivery for a single function

func (OnFlowDeliveryFunc) OnFlowDelivery

func (f OnFlowDeliveryFunc) OnFlowDelivery(ctx context.Context, flow *pb.Flow) (stop, error)

OnFlowDelivery is invoked before a flow is delivered via the API

type OnGetFlows

type OnGetFlows interface {
	OnGetFlows(context.Context, *observer.GetFlowsRequest) (context.Context, error)
}

OnGetFlows is invoked for each GetFlows call

type OnGetFlowsFunc

type OnGetFlowsFunc func(context.Context, *observer.GetFlowsRequest) (context.Context, error)

OnGetFlowsFunc implements OnGetFlows for a single function

func (OnGetFlowsFunc) OnGetFlows

OnGetFlows is invoked for each GetFlows call

type OnMonitorEvent

type OnMonitorEvent interface {
	OnMonitorEvent(context.Context, *observerTypes.MonitorEvent) (stop, error)
}

OnMonitorEvent is invoked before each monitor event is decoded

type OnMonitorEventFunc

type OnMonitorEventFunc func(context.Context, *observerTypes.MonitorEvent) (stop, error)

OnMonitorEventFunc implements OnMonitorEvent for a single function

func (OnMonitorEventFunc) OnMonitorEvent

func (f OnMonitorEventFunc) OnMonitorEvent(ctx context.Context, event *observerTypes.MonitorEvent) (stop, error)

OnMonitorEvent is invoked before each monitor event is decoded

type OnServerInit

type OnServerInit interface {
	OnServerInit(Server) error
}

OnServerInit is invoked after all server options have been applied

type OnServerInitFunc

type OnServerInitFunc func(Server) error

OnServerInitFunc implements OnServerInit for a single function

func (OnServerInitFunc) OnServerInit

func (f OnServerInitFunc) OnServerInit(srv Server) error

OnServerInit is invoked after all server options have been applied

type Option

type Option func(o *Options) error

Option customizes the configuration of the hubble server.

func WithCiliumDaemon

func WithCiliumDaemon(daemon CiliumDaemon) Option

WithCiliumDaemon provides access to the Cilium daemon via downcast

func WithMaxFlows

func WithMaxFlows(capacity container.Capacity) Option

WithMaxFlows that the ring buffer is initialized to hold.

func WithMonitorBuffer

func WithMonitorBuffer(size int) Option

WithMonitorBuffer controls the size of the buffered channel between the monitor socket and the hubble ring buffer.

func WithOnBuildFilter

func WithOnBuildFilter(f filters.OnBuildFilter) Option

WithOnBuildFilter adds a new callback to be invoked while building a flow filter

func WithOnBuildFilterFunc

func WithOnBuildFilterFunc(f filters.OnBuildFilterFunc) Option

WithOnBuildFilterFunc adds a new callback to be invoked while building flow filters

func WithOnDecodedEvent

func WithOnDecodedEvent(f OnDecodedEvent) Option

WithOnDecodedEvent adds a new callback to be invoked after decoding an event.

func WithOnDecodedEventFunc

func WithOnDecodedEventFunc(f func(context.Context, *v1.Event) (stop, error)) Option

WithOnDecodedEventFunc adds a new callback to be invoked after decoding an event

func WithOnDecodedFlow

func WithOnDecodedFlow(f OnDecodedFlow) Option

WithOnDecodedFlow adds a new callback to be invoked after decoding

func WithOnDecodedFlowFunc

func WithOnDecodedFlowFunc(f func(context.Context, *pb.Flow) (stop, error)) Option

WithOnDecodedFlowFunc adds a new callback to be invoked after decoding

func WithOnFlowDelivery

func WithOnFlowDelivery(f OnFlowDelivery) Option

WithOnFlowDelivery adds a new callback to be invoked before a flow is delivered via the API

func WithOnFlowDeliveryFunc

func WithOnFlowDeliveryFunc(f OnFlowDeliveryFunc) Option

WithOnFlowDeliveryFunc adds a new callback to be invoked before a flow is delivered via the API

func WithOnGetFlows

func WithOnGetFlows(f OnGetFlows) Option

WithOnGetFlows adds a new callback to be invoked for each GetFlows call

func WithOnGetFlowsFunc

func WithOnGetFlowsFunc(f OnGetFlowsFunc) Option

WithOnGetFlowsFunc adds a new callback to be invoked for each GetFlows call

func WithOnMonitorEvent

func WithOnMonitorEvent(f OnMonitorEvent) Option

WithOnMonitorEvent adds a new callback to be invoked before decoding

func WithOnMonitorEventFunc

func WithOnMonitorEventFunc(f func(context.Context, *observerTypes.MonitorEvent) (stop, error)) Option

WithOnMonitorEventFunc adds a new callback to be invoked before decoding

func WithOnServerInit

func WithOnServerInit(f OnServerInit) Option

WithOnServerInit adds a new callback to be invoked after server initialization

func WithOnServerInitFunc

func WithOnServerInitFunc(f func(Server) error) Option

WithOnServerInitFunc adds a new callback to be invoked after server initialization

type Options

type Options struct {
	MaxFlows      container.Capacity // max number of flows that can be stored in the ring buffer
	MonitorBuffer int                // buffer size for monitor payload

	CiliumDaemon CiliumDaemon // when running inside Cilium, contains a reference to the daemon

	OnServerInit   []OnServerInit          // invoked when the hubble server is initialized
	OnMonitorEvent []OnMonitorEvent        // invoked before an event is decoded
	OnDecodedFlow  []OnDecodedFlow         // invoked after a flow has been decoded
	OnDecodedEvent []OnDecodedEvent        // invoked after an event has been decoded
	OnBuildFilter  []filters.OnBuildFilter // invoked while building a flow filter
	OnFlowDelivery []OnFlowDelivery        // invoked before a flow is delivered via API
	OnGetFlows     []OnGetFlows            // invoked on new GetFlows API call
}

Options stores all the configurations values for the hubble server.

type Server

type Server interface {
	GetOptions() Options
	GetLogger() logrus.FieldLogger
}

Server gives access to the Hubble server

Jump to

Keyboard shortcuts

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