fsdiff

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFileSize = 1024 * 10 // max diff size of 10MB

Variables

View Source
var ErrFileTooLarge = errors.New("file too big to diff")

Functions

func HTMLPrintFileDiff

func HTMLPrintFileDiff(diffs FileDiff) string

func PrettyPrintFileDiffs

func PrettyPrintFileDiffs(diffs []FileDiff) string

Types

type Delta

type Delta struct {
	Type   DeltaType
	Name   string
	Deltas []*Delta
}

func Tree

func Tree(aPath, bPath string, afs, bfs fs.FS, ignore ...string) (*Delta, error)

func (Delta) Changed

func (d Delta) Changed() bool

func (Delta) String

func (d Delta) String() string

type DeltaType

type DeltaType uint8
const (
	DTUnchanged DeltaType = iota
	DTAdd
	DTChange
	DTRemove
)

func (DeltaType) String

func (t DeltaType) String() string

type FileDiff

type FileDiff struct {
	Type    DeltaType
	Path    string
	DiffErr string
	Diff    []diffmatchpatch.Diff
}

func Unix

func Unix(aPath, bPath string, afs, bfs fs.FS, ignore ...string) (diffs []FileDiff, err error)

Jump to

Keyboard shortcuts

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