dependency

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongType = errors.New("wrong type")
)

Functions

func DefaultEFIVar

func DefaultEFIVar(ctx context.Context) (efivarfs.EFIVar, error)

func DefaultFilesystem

func DefaultFilesystem(ctx context.Context) fs.FS

func EFIVar

EFIVarFromContext returns the efivar from the given context.

func Filesystem

func Filesystem(ctx context.Context, ctor FilesystemConstructor) (fs.FS, error)

FilesystemFromContext returns the filesystem from the given context.

func WithEFIVar

func WithEFIVar(ctx context.Context, efivar efivarfs.EFIVar) context.Context

EFIVarContext returns a context with the given efivar.

func WithFilesystem

func WithFilesystem(ctx context.Context, fsys fs.FS) context.Context

FilesystemContext returns a context with the given filesystem.

Types

type EfiVarsConstructor

type EfiVarsConstructor func() (efivarfs.EFIVar, error)

type FakeEfiVars

type FakeEfiVars struct {
	Content    map[efivarfs.VariableDescriptor][]byte
	Attributes map[efivarfs.VariableDescriptor]efivarfs.VariableAttributes
}

func NewFakeEfiVars

func NewFakeEfiVars() *FakeEfiVars

func (*FakeEfiVars) Get

func (*FakeEfiVars) List

func (*FakeEfiVars) Remove

func (e *FakeEfiVars) Remove(desc efivarfs.VariableDescriptor) error

func (*FakeEfiVars) Set

type FilesystemConstructor

type FilesystemConstructor func() (fs.FS, error)

type PassthroughFS added in v0.3.1

type PassthroughFS struct{}

func (*PassthroughFS) Open added in v0.3.1

func (*PassthroughFS) Open(name string) (fs.File, error)

Jump to

Keyboard shortcuts

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