archive

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPIOWriter

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

CPIOWriter implements Writer for cpio.CPIOWriter.

func NewCPIOWriter

func NewCPIOWriter(w io.Writer) *CPIOWriter

NewCPIOWriter creates a new archive writer.

func (*CPIOWriter) Close

func (w *CPIOWriter) Close() error

Close closes the Writer. Flush is called by the underlying closer.

func (*CPIOWriter) Flush

func (w *CPIOWriter) Flush() error

Flush writes the data to the underlying io.Writer.

func (*CPIOWriter) WriteDirectory

func (w *CPIOWriter) WriteDirectory(path string) error

WriteDirectory add a directory entry for the given path to the archive.

func (w *CPIOWriter) WriteLink(path, target string) error

WriteLink adds a symbolic link for the given path pointing to the given target.

func (*CPIOWriter) WriteRegular

func (w *CPIOWriter) WriteRegular(path string, source fs.File, mode fs.FileMode) error

WriteRegular copies the exisiting file from source into the archive.

type MockWriter

type MockWriter struct {
	Path        string
	RelatedPath string
	Source      fs.File
	Mode        fs.FileMode
	Err         error
}

func (*MockWriter) WriteDirectory

func (m *MockWriter) WriteDirectory(path string) error
func (m *MockWriter) WriteLink(path, target string) error

func (*MockWriter) WriteRegular

func (m *MockWriter) WriteRegular(path string, source fs.File, mode fs.FileMode) error

type Writer

type Writer interface {
	WriteRegular(string, fs.File, fs.FileMode) error
	WriteDirectory(string) error
	WriteLink(string, string) error
}

Writer defines initramfs archive writer interface.

Jump to

Keyboard shortcuts

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