Documentation
¶
Index ¶
- Constants
- func PrintColor(p *PrintOption)
- func PrintNumber(p *PrintOption)
- func PrintUnified(p *PrintOption)
- func Reader[T comparable](d []Delta[T], toString func(T) string, opts ...PrinterOption) io.Reader
- func StrconvAny(e any) string
- func StrconvFmt[T any](e T) string
- func StrconvInt(i int) string
- func StrconvString(str string) string
- func String[T comparable](d []Delta[T], toString func(T) string, opts ...PrinterOption) string
- type Delta
- type Kind
- type PrintOption
- type Printer
- type PrinterOption
- type Range
- type Subset
Constants ¶
View Source
const ( UNKNOWN = iota EQUAL ADDED DELETED CHANGED )
Variables ¶
This section is empty.
Functions ¶
func PrintColor ¶
func PrintColor(p *PrintOption)
func PrintNumber ¶
func PrintNumber(p *PrintOption)
func PrintUnified ¶
func PrintUnified(p *PrintOption)
func Reader ¶
func Reader[T comparable](d []Delta[T], toString func(T) string, opts ...PrinterOption) io.Reader
func StrconvAny ¶
func StrconvFmt ¶
func StrconvInt ¶
func StrconvString ¶
func String ¶
func String[T comparable](d []Delta[T], toString func(T) string, opts ...PrinterOption) string
Types ¶
type Delta ¶
type Delta[T comparable] struct { Left Subset[T] Right Subset[T] Kind Kind }
func Diff ¶
func Diff[T comparable](left, right []T) []Delta[T]
Diff implements Myers Diff algorithm, slice of Delta which contains the merged content of the parameters.
type PrintOption ¶
type PrintOption struct {
// contains filtered or unexported fields
}
type Printer ¶
type Printer[T comparable] struct { // contains filtered or unexported fields }
func NewPrinter ¶
func NewPrinter[T comparable](toString func(T) string, opts ...PrinterOption) *Printer[T]
func (*Printer[T]) Configure ¶
func (p *Printer[T]) Configure(opts ...PrinterOption)
type PrinterOption ¶
type PrinterOption func(p *PrintOption)
func PrintPrefix ¶
func PrintPrefix(left, right string) PrinterOption
Click to show internal directories.
Click to hide internal directories.