patch

package
v0.1.83 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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