Documentation ¶
Index ¶
- Constants
- func ApplyLineDiff(str1 string, diffBytes []byte) (string, error)
- func ApplyMapDiff(oldMap map[string][]byte, diffBytes []byte) (map[string][]byte, error)
- func MakeLineDiff(str1 string, str2 string, splitString string) []byte
- func MakeMapDiff(m1 map[string][]byte, m2 map[string][]byte) []byte
- type LineDiffType
- type MapDiffType
- type SingleLineEntry
Constants ¶
View Source
const LineDiffVersion = 1
View Source
const LineDiffVersion_0 = 0
View Source
const MapDiffVersion = 1
View Source
const MapDiffVersion_0 = 0
Variables ¶
This section is empty.
Functions ¶
func ApplyMapDiff ¶
Types ¶
type LineDiffType ¶
type LineDiffType struct { Version int SplitString string // added in version 1 Lines []SingleLineEntry NewData []string }
func (*LineDiffType) Clear ¶
func (diff *LineDiffType) Clear()
func (*LineDiffType) Decode ¶
func (rtn *LineDiffType) Decode(diffBytes []byte) error
func (*LineDiffType) Decode_v0 ¶
func (rtn *LineDiffType) Decode_v0(diffBytes []byte) error
func (LineDiffType) Dump ¶
func (diff LineDiffType) Dump()
func (LineDiffType) Encode ¶
func (diff LineDiffType) Encode() []byte
version 1 updates the diff to include the split-string it also encodes all the strings with run-length encoding
func (LineDiffType) Encode_v0 ¶
func (diff LineDiffType) Encode_v0() []byte
version 0 is no longer used, but kept here as a reference for decoding simple encoding write varints. first version, then then len, then len-number-of-varints, then fill the rest with newdata [version] [len-varint] [varint]xlen... newdata (bytes)
type MapDiffType ¶
func (*MapDiffType) Clear ¶
func (diff *MapDiffType) Clear()
func (*MapDiffType) Decode ¶
func (diff *MapDiffType) Decode(diffBytes []byte) error
func (*MapDiffType) Decode_v0 ¶
func (diff *MapDiffType) Decode_v0(diffBytes []byte) error
func (MapDiffType) Dump ¶
func (diff MapDiffType) Dump()
func (MapDiffType) Encode ¶
func (diff MapDiffType) Encode() []byte
we sort map keys and remove values to make the diff deterministic
func (MapDiffType) Encode_v0 ¶
func (diff MapDiffType) Encode_v0() []byte
this is kept for reference
type SingleLineEntry ¶
Click to show internal directories.
Click to hide internal directories.