fakertmr

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package fakertmr defines a configfsi.Client for faking TSM behavior. The current implementation only supports TDX.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RtmrSubsystem

type RtmrSubsystem struct {
	// WriteAttr called on any WriteFile to an attribute.
	WriteAttr func(dirname string, attr string, contents []byte, indexMap map[int]bool) error
	// ReadAttr is called on any non-InAddr key.
	ReadAttr func(dirname string, attr string) ([]byte, error)
	// Random is the source of randomness to use for MkdirTemp
	Random io.Reader
	// We use a temp folder to store the rtmr entries.
	// The path to the fake rtmr subsystem.
	Path string
	// contains filtered or unexported fields
}

RtmrSubsystem represents a fake configfs-tsm rtmr subsystem.

func CreateRtmrSubsystem

func CreateRtmrSubsystem(tempDir string) *RtmrSubsystem

CreateRtmrSubsystem creates a new rtmr subsystem. The current subsystem only supports TDX.

func (*RtmrSubsystem) MkdirTemp

func (r *RtmrSubsystem) MkdirTemp(dir, pattern string) (string, error)

MkdirTemp creates a new temporary directory in the rtmr subsystem.

func (*RtmrSubsystem) ReadDir added in v0.3.1

func (r *RtmrSubsystem) ReadDir(dirname string) ([]os.DirEntry, error)

ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.

func (*RtmrSubsystem) ReadFile

func (r *RtmrSubsystem) ReadFile(name string) ([]byte, error)

ReadFile reads the contents of a file in the rtmr subsystem.

func (*RtmrSubsystem) RemoveAll

func (r *RtmrSubsystem) RemoveAll(path string) error

RemoveAll implements configfsi.Client.

func (*RtmrSubsystem) WriteFile

func (r *RtmrSubsystem) WriteFile(name string, content []byte) error

WriteFile writes the contents to a file in the rtmr subsystem.

Jump to

Keyboard shortcuts

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