Documentation
¶
Overview ¶
Package textdiff providers support for diff'ing text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DP ¶
func DP(a, b string) *lcs.EditScript[rune]
DP uses cloudeng.io/algo/lcs.DP to generate diffs.
func LineFNVHashDecoder ¶
LineFNVHashDecoder decodes a byte slice into newline delimited blocks each of which is represented by a 64 bit hash obtained from fnv.New64a.
Types ¶
type Diff ¶
type Diff struct {
// contains filtered or unexported fields
}
Diff represents the ability to diff two slices.
func LinesMyers ¶
LinesMyers uses cloudeng.io/algo/lcs.Myers to generate diffs.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a single diff 'group', that is a set of insertions/deletions that are pertain to the same set of lines.
type LineDecoder ¶
type LineDecoder struct {
// contains filtered or unexported fields
}
LineDecoder represents a decoder that can be used to split a byte stream into lines for use with the cloudeng.io/algo/lcs package.
func NewLineDecoder ¶
func NewLineDecoder(fn func(data []byte) (string, int64, int)) *LineDecoder
NewLineDecoder returns a new instance of LineDecoder.
func (*LineDecoder) Decode ¶
func (ld *LineDecoder) Decode(data []byte) (int64, int)
Decode can be used as the decode function when creating a new decoder using cloudeng.io/algo.codec.NewDecoder.
func (*LineDecoder) Line ¶
func (ld *LineDecoder) Line(i int) (string, uint64)
Line returns the i'th line.
func (*LineDecoder) NumLines ¶
func (ld *LineDecoder) NumLines() int
NumLines returns the number of lines decoded.