isoeditor

package
v0.0.0-...-f822399 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 21 Imported by: 6

Documentation

Overview

Package isoeditor is a generated GoMock package.

Index

Constants

View Source
const (
	RamDiskPaddingLength = uint64(1024 * 1024) // 1MB

)

Variables

This section is empty.

Functions

func Create

func Create(outPath string, workDir string, volumeLabel string) error

Create builds an iso file at outPath with the given volumeLabel using the contents of the working directory

func CreateMinimalISO

func CreateMinimalISO(extractDir, volumeID, rootFSURL, arch, minimalISOPath string) error

CreateMinimalISO Creates the minimal iso by removing the rootfs and adding the url

func Extract

func Extract(isoPath string, workDir string) error

Extract unpacks the iso contents into the working directory

func GetFileFromISO

func GetFileFromISO(isoPath, filePath string) (filesystem.File, error)

Gets a readWrite seeker of a specific file from the ISO image

func GetISOFileInfo

func GetISOFileInfo(filePath, isoPath string) (int64, int64, error)

func KargsFiles

func KargsFiles(isoPath string) ([]string, error)

func KargsToStr

func KargsToStr(args []string) (string, error)

func NewInitRamFSStreamReader

func NewInitRamFSStreamReader(irfsPath string, ignitionContent *IgnitionContent) (overlay.OverlayReader, error)

func NewInitRamFSStreamReaderFromISO

func NewInitRamFSStreamReaderFromISO(isoPath string, ignitionContent *IgnitionContent) (overlay.OverlayReader, error)

func ReadFileFromISO

func ReadFileFromISO(isoPath, filePath string) ([]byte, error)

Reads a whole specific file from the ISO image

func StrToKargs

func StrToKargs(kargsStr string) ([]string, error)

func VolumeIdentifier

func VolumeIdentifier(isoPath string) (string, error)

Types

type BoundariesFinder

type BoundariesFinder func(filePath, isoPath string) (int64, int64, error)

type Editor

type Editor interface {
	CreateMinimalISOTemplate(fullISOPath, rootFSURL, arch, minimalISOPath string) error
}

func NewEditor

func NewEditor(dataDir string) Editor

type FileData

type FileData struct {
	Filename string
	Data     io.ReadCloser
}

func NewIgnitionImageReader

func NewIgnitionImageReader(isoPath string, ignitionContent *IgnitionContent) ([]FileData, error)

NewIgnitionImageReader returns the filename of the ignition image in the ISO, along with a stream of the ignition image with ignition content embedded. This can be used to overwrite the ignition image file of an ISO previously unpacked by Extract() in order to embed ignition data.

func NewKargsReader

func NewKargsReader(isoPath string, appendKargs string) ([]FileData, error)

NewKargsReader returns the filename within an ISO and the new content of the file(s) containing the kernel arguments, with additional arguments appended.

type FileReader

type FileReader func(isoPath, filePath string) ([]byte, error)

type IgnitionContent

type IgnitionContent struct {
	Config []byte
}

func (*IgnitionContent) Archive

func (ic *IgnitionContent) Archive() (*bytes.Reader, error)

type ImageReader

type ImageReader = overlay.OverlayReader

func NewRHCOSStreamReader

func NewRHCOSStreamReader(isoPath string, ignitionContent *IgnitionContent, ramdiskContent []byte, kargs []byte) (ImageReader, error)

type MockEditor

type MockEditor struct {
	// contains filtered or unexported fields
}

MockEditor is a mock of Editor interface.

func NewMockEditor

func NewMockEditor(ctrl *gomock.Controller) *MockEditor

NewMockEditor creates a new mock instance.

func (*MockEditor) CreateMinimalISOTemplate

func (m *MockEditor) CreateMinimalISOTemplate(arg0, arg1, arg2, arg3 string) error

CreateMinimalISOTemplate mocks base method.

func (*MockEditor) EXPECT

func (m *MockEditor) EXPECT() *MockEditorMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockEditorMockRecorder

type MockEditorMockRecorder struct {
	// contains filtered or unexported fields
}

MockEditorMockRecorder is the mock recorder for MockEditor.

func (*MockEditorMockRecorder) CreateMinimalISOTemplate

func (mr *MockEditorMockRecorder) CreateMinimalISOTemplate(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

CreateMinimalISOTemplate indicates an expected call of CreateMinimalISOTemplate.

type StreamGeneratorFunc

type StreamGeneratorFunc func(isoPath string, ignitionContent *IgnitionContent, ramdiskContent, kargs []byte) (ImageReader, error)

Jump to

Keyboard shortcuts

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