host

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GivePermissions added in v0.0.2

func GivePermissions(filepath, uid, permissions string) error

GivePermissions will give read/write permissions on a file to a specified user id.

Types

type FakeHandler

type FakeHandler interface {
	Handler
	SetKernalVersion(version string)
	SetAllowsUnprivilegedBpf(allowed bool)
}

FakeHandler interface extends the Handler interface to provide additional testing methods.

func NewFakeHandler

func NewFakeHandler() FakeHandler

NewFakeHandler returns an implementation of the FakeHandler interface.

type Handler

type Handler interface {
	AllowsUnprivilegedBpf() (bool, error)
	KernelVersion() (string, error)
	HasEthtool() (bool, string, error)
	HasLibbpf() (bool, []string, error)
	HasDevlink() (bool, string, error)
	Hostname() (string, error)
}

Handler is the CNI and device plugins interface to the host. The interface exists for testing purposes, allowing unit tests to test against a fake API.

func NewHandler

func NewHandler() Handler

NewHandler returns an implementation of the Handler interface.

Jump to

Keyboard shortcuts

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