patch

package
v0.1.101 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, options CreateOptions) (patch string, err error)

Types

type CreateOptions

type CreateOptions struct {
	Directory     string
	Before, After map[string][]byte
}

type File

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

func Parse

func Parse(ctx context.Context, raw []byte) ([]*File, error)

func (*File) Apply

func (f *File) Apply(ctx context.Context, body []byte) ([]byte, error)

func (*File) Metadata

func (f *File) Metadata() FileMetadata

func (*File) Reverse

func (f *File) Reverse(ctx context.Context) (*File, error)

func (*File) String

func (f *File) String() string

type FileMetadata

type FileMetadata struct {
	OldName, NewName                            string
	OldMode, NewMode                            os.FileMode
	IsNew, IsDelete, IsRename, IsCopy, IsBinary bool
}

type MergeOptions

type MergeOptions struct {
	Directory     string
	Base, Current map[string][]byte
	Patch         string
}

type Result

type Result struct {
	Files     map[string][]byte
	Conflicts []string
}

func Merge

func Merge(ctx context.Context, options MergeOptions) (result Result, err error)

Jump to

Keyboard shortcuts

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