func fileDelV4(data []byte) ([]byte, FileDel, error) {
var f FileDel
f.Encoding = "UTF-8"
data, _, err := tuple(
assign(&f.Del, atom),
assign(&f.Contents, mapValue(option(atom), func(p *Atom) Atom {
if p == nil {
return nil
}
return *p
})),
assign(&f.Path, toString(lengthData(uint64LE))),
)(data)
return data, f, err
}
type ResurrectZombies struct {
Change Atom
Local Local
Encoding string
}
func (r ResurrectZombies) atoms() []Atom {
return []Atom{r.Change}
}
func resurrectZombies(data []byte) ([]byte, ResurrectZombies, error) {
var r ResurrectZombies
data, _, err := tuple(
assign(&r.Change, atom),
assign(&r.Local, local),
assign(&r.Encoding, optionalString),
)(data)
return data, r, err
}
func resurrectZombiesV4(data []byte) ([]byte, ResurrectZombies, error) {
var r ResurrectZombies
r.Encoding = "UTF-8"
data, _, err := tuple(
assign(&r.Change, atom),
assign(&r.Local, local),
)(data)
return data, r, err
}
type FileUndel struct {
Undel Atom
Contents Atom
Path string
Encoding string
}
func (f FileUndel) atoms() []Atom {
if f.Contents == nil {
return []Atom{f.Undel}
}
return []Atom{f.Undel, f.Contents}
}
func fileUndel(data []byte) ([]byte, FileUndel, error) {
var f FileUndel
data, _, err := tuple(
assign(&f.Undel, atom),
assign(&f.Contents, mapValue(option(atom), func(p *Atom) Atom {
if p == nil {
return nil
}
return *p
})),
assign(&f.Path, toString(lengthData(uint64LE))),
assign(&f.Encoding, optionalString),
)(data)
return data, f, err
}
func fileUndelV4(data []byte) ([]byte, FileUndel, error) {
var f FileUndel
f.Encoding = "UTF-8"
data, _, err := tuple(
assign(&f.Undel, atom),
assign(&f.Contents, mapValue(option(atom), func(p *Atom) Atom {
if p == nil {
return nil
}
return *p
})),
assign(&f.Path, toString(lengthData(uint64LE))),
)(data)
return data, f, err
}
type FileMove struct {
Del Atom
Add Atom
Path string
}
func (f FileMove) atoms() []Atom {
return []Atom{f.Del, f.Add}
}
func fileMove(data []byte) ([]byte, FileMove, error) {
var f FileMove
data, _, err := tuple(
assign(&f.Del, atom),
assign(&f.Add, atom),
assign(&f.Path, rustString),
)(data)
return data, f, err
}
type SolveNameConflict struct {
Name Atom
Path string
}
func (s SolveNameConflict) atoms() []Atom {
return []Atom{s.Name}
}
func solveNameConflict(data []byte) ([]byte, SolveNameConflict, error) {
var s SolveNameConflict
data, _, err := tuple(
assign(&s.Name, atom),
assign(&s.Path, rustString),
)(data)
return data, s, err
}