dependency

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: BSD-2-Clause Imports: 6 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 DefaultTPM

func DefaultTPM(ctx context.Context) (*tss.TPM, error)

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 TPM

func TPM(ctx context.Context, ctor TpmConstructor) (*tss.TPM, error)

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.

func WithTPM

func WithTPM(ctx context.Context, tpm *tss.TPM) context.Context

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)

type TpmConstructor

type TpmConstructor func() (*tss.TPM, error)

Jump to

Keyboard shortcuts

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