pin

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkDir

func WalkDir(root string, bpffn WalkDirFunc) error

WalkDir walks the file tree rooted at path, calling bpffn for each node in the tree, including directories. Running WalkDir on a non-bpf filesystem is an error. Otherwise identical in behavior to fs.WalkDir.

See the WalkDirFunc for more information.

Types

type Pinner

type Pinner interface {
	Pin(string) error
}

Pinner is an interface implemented by all eBPF objects that support pinning to a bpf virtual filesystem.

func Load

func Load(path string, opts *ebpf.LoadPinOptions) (Pinner, error)

Load retrieves a pinned object from a bpf virtual filesystem. It returns one of ebpf.Map, ebpf.Program, or link.Link.

Trying to open anything other than a bpf object is an error.

type WalkDirFunc

type WalkDirFunc func(path string, d fs.DirEntry, obj Pinner, err error) error

WalkDirFunc is the type of the function called for each object visited by WalkDir. It's identical to fs.WalkDirFunc, but with an extra Pinner argument. If the visited node is a directory, obj is nil.

err contains any errors encountered during bpffs traversal or object loading.

Jump to

Keyboard shortcuts

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