meta

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvServiceName   = "OTEL_SERVICE_NAME"
	EnvResourceAttrs = "OTEL_RESOURCE_ATTRIBUTES"
)

Variables

This section is empty.

Functions

Types

type BaseNotifier

type BaseNotifier struct {
	// contains filtered or unexported fields
}

func NewBaseNotifier

func NewBaseNotifier(log *slog.Logger) BaseNotifier

func (*BaseNotifier) Notify

func (i *BaseNotifier) Notify(event *informer.Event)

func (*BaseNotifier) Subscribe

func (i *BaseNotifier) Subscribe(observer Observer)

func (*BaseNotifier) Unsubscribe

func (i *BaseNotifier) Unsubscribe(observer Observer)

type InformerOption

type InformerOption func(*informersConfig)

func RestrictNode added in v1.9.3

func RestrictNode(nodeName string) InformerOption

func WaitForCacheSync

func WaitForCacheSync() InformerOption

func WithCacheSyncTimeout

func WithCacheSyncTimeout(to time.Duration) InformerOption

func WithKubeClient

func WithKubeClient(client kubernetes.Interface) InformerOption

func WithKubeConfigPath

func WithKubeConfigPath(path string) InformerOption

func WithResyncPeriod

func WithResyncPeriod(period time.Duration) InformerOption

func WithoutNodes

func WithoutNodes() InformerOption

func WithoutServices

func WithoutServices() InformerOption

type Informers

type Informers struct {
	BaseNotifier
	// contains filtered or unexported fields
}

func InitInformers

func InitInformers(ctx context.Context, opts ...InformerOption) (*Informers, error)

func (*Informers) Subscribe

func (inf *Informers) Subscribe(observer Observer)

type Notifier

type Notifier interface {
	Subscribe(observer Observer)
	Unsubscribe(observer Observer)
	Notify(event *informer.Event)
}

Notifier can get subscriptions from Observers

type Observer

type Observer interface {
	ID() string
	// On new event. If the observer returns an error, it will be assumed as invalid and will be automatically
	// unsubscribed from the notifier. The Observer implementation should free its occupied resources and finish
	// its execution
	On(event *informer.Event) error
}

Observer can be subscribed to a Notifier to receive events

Directories

Path Synopsis
This implementation is a derivation of the code in https://github.com/netobserv/netobserv-ebpf-agent/tree/release-1.4
This implementation is a derivation of the code in https://github.com/netobserv/netobserv-ebpf-agent/tree/release-1.4

Jump to

Keyboard shortcuts

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