32 lines
473 B
Go
32 lines
473 B
Go
|
package diffsync
|
||
|
|
||
|
type EditsStack []*Edits
|
||
|
|
||
|
type Ops interface{}
|
||
|
|
||
|
type Edits struct {
|
||
|
ops Ops
|
||
|
localVersion Version
|
||
|
remoteVersion Version
|
||
|
}
|
||
|
|
||
|
func (e *Edits) Ops() Ops {
|
||
|
return e.ops
|
||
|
}
|
||
|
|
||
|
func (e *Edits) LocalVersion() Version {
|
||
|
return e.localVersion
|
||
|
}
|
||
|
|
||
|
func (e *Edits) RemoteVersion() Version {
|
||
|
return e.remoteVersion
|
||
|
}
|
||
|
|
||
|
type Differ interface {
|
||
|
Diff(new, old []byte) (Ops, error)
|
||
|
}
|
||
|
|
||
|
type Patcher interface {
|
||
|
Patch(content []byte, ops Ops) ([]byte, error)
|
||
|
}
|