package pin

import "github.com/cilium/ebpf/pin"

Index

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.

Source Files

doc.go load.go walk.go

Version
v0.17.0
Published
Dec 18, 2024
Platform
darwin/amd64
Imports
9 packages
Last checked
18 minutes ago

Tools for package owners.