watch

package
v1.8.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package watch provides netlink watchers via multicast groups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitedTrigger

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

RateLimitedTrigger wraps a Trigger with rate limiting.

func NewDefaultRateLimitedTrigger

func NewDefaultRateLimitedTrigger(ctx context.Context, trigger Trigger) *RateLimitedTrigger

NewDefaultRateLimitedTrigger creates a new RateLimitedTrigger with default params.

func NewRateLimitedTrigger

func NewRateLimitedTrigger(ctx context.Context, trigger Trigger, rateLimit rate.Limit, burst int) *RateLimitedTrigger

NewRateLimitedTrigger creates a new RateLimitedTrigger with specified params.

Trigger's goroutine exists when the context is canceled.

func (*RateLimitedTrigger) QueueReconcile

func (t *RateLimitedTrigger) QueueReconcile()

QueueReconcile implements Trigger interface.

The event is queued if the goroutine is ready to accept it (otherwise it's already busy processing a previous event). This function returns immediately.

type Trigger

type Trigger interface {
	QueueReconcile()
}

Trigger is used by watcher to trigger reconcile loops.

type Watcher

type Watcher interface {
	Done()
}

Watcher interface allows to stop watching.

func NewEthtool

func NewEthtool(trigger Trigger) (Watcher, error)

NewEthtool starts ethtool watch.

func NewRtNetlink(trigger Trigger, groups uint32) (Watcher, error)

NewRtNetlink starts rtnetlink watch over specified groups.

Jump to

Keyboard shortcuts

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