patch

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPatch

type MockPatch[Content ~string | ~[]byte] struct {
	// contains filtered or unexported fields
}

MockPatch is a type that represents a collection of files with their contents, used to apply these files to a specified root directory within the filesystem. It supports both string and byte slice content types.

func Mock

func Mock[Content interface{ ~string | ~[]byte }](files map[string]Content) *MockPatch[Content]

Mock creates a new MockPatch instance with the provided map of files and their corresponding content.

func (*MockPatch[_]) Apply

func (p *MockPatch[_]) Apply(ctx context.Context, root string) error

Apply writes the contents of the MockPatch to the specified root directory using the provided context. It returns an error if any issues occur during file creation or writing.

Jump to

Keyboard shortcuts

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