| 1 | package sendscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ |
| 2 | |
| 3 | import ( |
| 4 | "errorsscip-go gomod github.com/golang/go/src go1.12 errors/" |
| 5 | "fmtscip-go gomod github.com/golang/go/src go1.12 fmt/" |
| 6 | "github.com/dennwc/btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/" |
| 7 | "ioscip-go gomod github.com/golang/go/src go1.12 io/" |
| 8 | "io/ioutilscip-go gomod github.com/golang/go/src go1.12 `io/ioutil`/" |
| 9 | "timescip-go gomod github.com/golang/go/src go1.12 time/" |
| 10 | ) |
| 11 | |
| 12 | func NewStreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/NewStreamReader().(r ioscip-go gomod github.com/golang/go/src go1.12 io/.Readerscip-go gomod github.com/golang/go/src go1.12 io/Reader#) (*StreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#, error) { |
| 13 | // read magic and version |
| 14 | buf := make([]byte, len(sendStreamMagicscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagic.)+4) |
| 15 | _, err := ioscip-go gomod github.com/golang/go/src go1.12 io/.ReadFullscip-go gomod github.com/golang/go/src go1.12 io/ReadFull().(r, buf) |
| 16 | if err != nil { |
| 17 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("cannot read magic: %v", err) |
| 18 | } else if string(buf[:sendStreamMagicSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagicSize.]) != sendStreamMagicscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagic. { |
| 19 | return nil, errorsscip-go gomod github.com/golang/go/src go1.12 errors/.Newscip-go gomod github.com/golang/go/src go1.12 errors/New().("unexpected stream header") |
| 20 | } |
| 21 | version := sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint32scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint32().(buf[sendStreamMagicSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagicSize.:]) |
| 22 | if version != sendStreamVersionscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamVersion. { |
| 23 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("stream version %d not supported", version) |
| 24 | } |
| 25 | return &StreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#{rscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#r.: r}, nil |
| 26 | } |
| 27 | |
| 28 | type StreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader# struct { |
| 29 | rscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#r. ioscip-go gomod github.com/golang/go/src go1.12 io/.Readerscip-go gomod github.com/golang/go/src go1.12 io/Reader# |
| 30 | bufscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#buf. [cmdHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeaderSize.]byte |
| 31 | } |
| 32 | |
| 33 | func (r *StreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#) readCmdHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#readCmdHeader().() (h cmdHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#, err error) { |
| 34 | _, err = ioscip-go gomod github.com/golang/go/src go1.12 io/.ReadFullscip-go gomod github.com/golang/go/src go1.12 io/ReadFull().(r.rscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#r., r.bufscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#buf.[:cmdHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeaderSize.]) |
| 35 | if err == ioscip-go gomod github.com/golang/go/src go1.12 io/.EOFscip-go gomod github.com/golang/go/src go1.12 io/EOF. { |
| 36 | return |
| 37 | } else if err != nil { |
| 38 | err = fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("cannot read command header: %v", err) |
| 39 | return |
| 40 | } |
| 41 | err = h.Unmarshalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Unmarshal().(r.bufscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#buf.[:cmdHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeaderSize.]) |
| 42 | // TODO: check CRC |
| 43 | return |
| 44 | } |
| 45 | |
| 46 | type SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV# struct { |
| 47 | Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. sendCmdAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr# |
| 48 | Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val. interface{} |
| 49 | } |
| 50 | |
| 51 | func (r *StreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#) readTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#readTLV().(rd ioscip-go gomod github.com/golang/go/src go1.12 io/.Readerscip-go gomod github.com/golang/go/src go1.12 io/Reader#) (*SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#, error) { |
| 52 | _, err := ioscip-go gomod github.com/golang/go/src go1.12 io/.ReadFullscip-go gomod github.com/golang/go/src go1.12 io/ReadFull().(rd, r.bufscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#buf.[:tlvHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeaderSize.]) |
| 53 | if err == ioscip-go gomod github.com/golang/go/src go1.12 io/.EOFscip-go gomod github.com/golang/go/src go1.12 io/EOF. { |
| 54 | return nil, err |
| 55 | } else if err != nil { |
| 56 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("cannot read tlv header: %v", err) |
| 57 | } |
| 58 | var h tlvHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader# |
| 59 | if err = h.Unmarshalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Unmarshal().(r.bufscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#buf.[:tlvHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeaderSize.]); err != nil { |
| 60 | return nil, err |
| 61 | } |
| 62 | typ := sendCmdAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr#(h.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Type.) |
| 63 | if sendCmdAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr#(typ) > sendAttrMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMax. { // || th.Len > _BTRFS_SEND_BUF_SIZE { |
| 64 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("invalid tlv in cmd: %q", typ) |
| 65 | } |
| 66 | buf := make([]byte, h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len.) |
| 67 | _, err = ioscip-go gomod github.com/golang/go/src go1.12 io/.ReadFullscip-go gomod github.com/golang/go/src go1.12 io/ReadFull().(rd, buf) |
| 68 | if err != nil { |
| 69 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("cannot read tlv: %v", err) |
| 70 | } |
| 71 | var v interface{} |
| 72 | switch typ { |
| 73 | case sendAttrCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtransid., sendAttrCloneCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneCtransid., |
| 74 | sendAttrUidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUid., sendAttrGidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrGid., sendAttrModescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMode., |
| 75 | sendAttrInoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrIno., sendAttrFileOffsetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrFileOffset., sendAttrSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrSize., |
| 76 | sendAttrCloneOffsetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneOffset., sendAttrCloneLenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneLen.: |
| 77 | if len(buf) != 8 { |
| 78 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("unexpected int64 size: %v", h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len.) |
| 79 | } |
| 80 | v = sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint64scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint64().(buf[:8]) |
| 81 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath., sendAttrPathToscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPathTo., sendAttrClonePathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrClonePath., sendAttrXattrNamescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrXattrName.: |
| 82 | v = string(buf) |
| 83 | case sendAttrDatascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrData., sendAttrXattrDatascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrXattrData.: |
| 84 | v = buf |
| 85 | case sendAttrUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUuid., sendAttrCloneUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneUuid.: |
| 86 | if h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len. != btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUIDSize. { |
| 87 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("unexpected UUID size: %v", h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len.) |
| 88 | } |
| 89 | var u btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID# |
| 90 | copy(u[:], buf) |
| 91 | v = u |
| 92 | case sendAttrAtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrAtime., sendAttrMtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMtime., sendAttrCtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtime., sendAttrOtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrOtime.: |
| 93 | if h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len. != 12 { |
| 94 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("unexpected timestamp size: %v", h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len.) |
| 95 | } |
| 96 | v = timescip-go gomod github.com/golang/go/src go1.12 time/.Unixscip-go gomod github.com/golang/go/src go1.12 time/Unix().( // btrfs_timespec |
| 97 | int64(sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint64scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint64().(buf[:8])), |
| 98 | int64(sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint32scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint32().(buf[8:])), |
| 99 | ) |
| 100 | default: |
| 101 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("unsupported tlv type: %v (len: %v)", typ, h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len.) |
| 102 | } |
| 103 | return &SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#{Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr.: typ, Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val.: v}, nil |
| 104 | } |
| 105 | func (r *StreamReaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#) ReadCommandscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#ReadCommand().() (_ Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/Cmd#, gerr error) { |
| 106 | h, err := r.readCmdHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#readCmdHeader().() |
| 107 | if err != nil { |
| 108 | return nil, err |
| 109 | } |
| 110 | var tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV# |
| 111 | rd := ioscip-go gomod github.com/golang/go/src go1.12 io/.LimitReaderscip-go gomod github.com/golang/go/src go1.12 io/LimitReader().(r.rscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#r., int64(h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Len.)) |
| 112 | defer ioscip-go gomod github.com/golang/go/src go1.12 io/.Copyscip-go gomod github.com/golang/go/src go1.12 io/Copy().(ioutilscip-go gomod github.com/golang/go/src go1.12 `io/ioutil`/.Discardscip-go gomod github.com/golang/go/src go1.12 `io/ioutil`/Discard., rd) |
| 113 | for { |
| 114 | tlv, err := r.readTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamReader#readTLV().(rd) |
| 115 | if err == ioscip-go gomod github.com/golang/go/src go1.12 io/.EOFscip-go gomod github.com/golang/go/src go1.12 io/EOF. { |
| 116 | break |
| 117 | } else if err != nil { |
| 118 | return nil, fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("command %v: %v", h.Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Cmd., err) |
| 119 | } |
| 120 | tlvs = append(tlvs, *tlv) |
| 121 | } |
| 122 | var c Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/Cmd# |
| 123 | switch h.Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Cmd. { |
| 124 | case sendCmdEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdEnd.: |
| 125 | c = &StreamEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamEnd#{} |
| 126 | case sendCmdSubvolscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSubvol.: |
| 127 | c = &SubvolCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#{} |
| 128 | case sendCmdSnapshotscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSnapshot.: |
| 129 | c = &SnapshotCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#{} |
| 130 | case sendCmdChownscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdChown.: |
| 131 | c = &ChownCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#{} |
| 132 | case sendCmdChmodscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdChmod.: |
| 133 | c = &ChmodCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#{} |
| 134 | case sendCmdUtimesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdUtimes.: |
| 135 | c = &UTimesCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#{} |
| 136 | case sendCmdMkdirscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkdir.: |
| 137 | c = &MkdirCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#{} |
| 138 | case sendCmdRenamescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdRename.: |
| 139 | c = &RenameCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#{} |
| 140 | case sendCmdMkfilescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkfile.: |
| 141 | c = &MkfileCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#{} |
| 142 | case sendCmdWritescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdWrite.: |
| 143 | c = &WriteCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#{} |
| 144 | case sendCmdTruncatescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdTruncate.: |
| 145 | c = &TruncateCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#{} |
| 146 | } |
| 147 | if c == nil { |
| 148 | return &UnknownSendCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#{Kindscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Kind.: h.Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Cmd., Paramsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Params.: tlvs}, nil |
| 149 | } |
| 150 | if err := c.decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/Cmd#decode.(tlvs); err != nil { |
| 151 | return nil, err |
| 152 | } |
| 153 | return c, nil |
| 154 | } |
| 155 | |
| 156 | type errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType# struct { |
| 157 | Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd. CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# |
| 158 | Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val. SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV# |
| 159 | } |
| 160 | |
| 161 | func (e errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#) Errorscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Error().() string { |
| 162 | return fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.12 fmt/Sprintf().("unexpected type for %q (in %q): %T", |
| 163 | e.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val..Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr., e.Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd., e.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val..Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val.) |
| 164 | } |
| 165 | |
| 166 | type errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr# struct { |
| 167 | Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd. CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# |
| 168 | Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val. SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV# |
| 169 | } |
| 170 | |
| 171 | func (e errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#) Errorscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Error().() string { |
| 172 | return fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.12 fmt/Sprintf().("unexpected attr %q for %q (%T)", |
| 173 | e.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val..Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr., e.Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd., e.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val..Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val.) |
| 174 | } |
| 175 | |
| 176 | type Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/Cmd# interface { |
| 177 | Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/Cmd#Type.() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# |
| 178 | decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/Cmd#decode.(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error |
| 179 | } |
| 180 | |
| 181 | type UnknownSendCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd# struct { |
| 182 | Kindscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Kind. CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# |
| 183 | Paramsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Params. []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV# |
| 184 | } |
| 185 | |
| 186 | func (c UnknownSendCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 187 | return c.Kindscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Kind. |
| 188 | } |
| 189 | func (c *UnknownSendCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 190 | c.Paramsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UnknownSendCmd#Params. = tlvs |
| 191 | return nil |
| 192 | } |
| 193 | |
| 194 | type StreamEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamEnd# struct{} |
| 195 | |
| 196 | func (c StreamEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamEnd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamEnd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 197 | return sendCmdEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdEnd. |
| 198 | } |
| 199 | func (c *StreamEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamEnd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/StreamEnd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 200 | if len(tlvs) != 0 { |
| 201 | return fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.12 fmt/Errorf().("unexpected TLVs for stream end command: %#v", tlvs) |
| 202 | } |
| 203 | return nil |
| 204 | } |
| 205 | |
| 206 | type SubvolCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd# struct { |
| 207 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#Path. string |
| 208 | UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#UUID. btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID# |
| 209 | CTransIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#CTransID. uint64 |
| 210 | } |
| 211 | |
| 212 | func (c SubvolCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 213 | return sendCmdSubvolscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSubvol. |
| 214 | } |
| 215 | func (c *SubvolCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 216 | for _, tlv := range tlvs { |
| 217 | var ok bool |
| 218 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 219 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 220 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 221 | case sendAttrUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUuid.: |
| 222 | c.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#UUID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID#) |
| 223 | case sendAttrCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtransid.: |
| 224 | c.CTransIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#CTransID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 225 | default: |
| 226 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#Type().()} |
| 227 | } |
| 228 | if !ok { |
| 229 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SubvolCmd#Type().()} |
| 230 | } |
| 231 | } |
| 232 | return nil |
| 233 | } |
| 234 | |
| 235 | type SnapshotCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd# struct { |
| 236 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#Path. string |
| 237 | UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#UUID. btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID# |
| 238 | CTransIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#CTransID. uint64 |
| 239 | CloneUUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#CloneUUID. btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID# |
| 240 | CloneTransIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#CloneTransID. uint64 |
| 241 | } |
| 242 | |
| 243 | func (c SnapshotCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 244 | return sendCmdSnapshotscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSnapshot. |
| 245 | } |
| 246 | func (c *SnapshotCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 247 | for _, tlv := range tlvs { |
| 248 | var ok bool |
| 249 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 250 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 251 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 252 | case sendAttrUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUuid.: |
| 253 | c.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#UUID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID#) |
| 254 | case sendAttrCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtransid.: |
| 255 | c.CTransIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#CTransID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 256 | case sendAttrCloneUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneUuid.: |
| 257 | c.CloneUUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#CloneUUID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID#) |
| 258 | case sendAttrCloneCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneCtransid.: |
| 259 | c.CloneTransIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#CloneTransID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 260 | default: |
| 261 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#Type().()} |
| 262 | } |
| 263 | if !ok { |
| 264 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SnapshotCmd#Type().()} |
| 265 | } |
| 266 | } |
| 267 | return nil |
| 268 | } |
| 269 | |
| 270 | type ChownCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd# struct { |
| 271 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#Path. string |
| 272 | UIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#UID., GIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#GID. uint64 |
| 273 | } |
| 274 | |
| 275 | func (c ChownCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 276 | return sendCmdChownscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdChown. |
| 277 | } |
| 278 | func (c *ChownCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 279 | for _, tlv := range tlvs { |
| 280 | var ok bool |
| 281 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 282 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 283 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 284 | case sendAttrUidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUid.: |
| 285 | c.UIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#UID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 286 | case sendAttrGidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrGid.: |
| 287 | c.GIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#GID., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 288 | default: |
| 289 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#Type().()} |
| 290 | } |
| 291 | if !ok { |
| 292 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChownCmd#Type().()} |
| 293 | } |
| 294 | } |
| 295 | return nil |
| 296 | } |
| 297 | |
| 298 | type ChmodCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd# struct { |
| 299 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Path. string |
| 300 | Modescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Mode. uint64 |
| 301 | } |
| 302 | |
| 303 | func (c ChmodCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 304 | return sendCmdChmodscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdChmod. |
| 305 | } |
| 306 | func (c *ChmodCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 307 | for _, tlv := range tlvs { |
| 308 | var ok bool |
| 309 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 310 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 311 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 312 | case sendAttrModescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMode.: |
| 313 | c.Modescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Mode., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 314 | default: |
| 315 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Type().()} |
| 316 | } |
| 317 | if !ok { |
| 318 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ChmodCmd#Type().()} |
| 319 | } |
| 320 | } |
| 321 | return nil |
| 322 | } |
| 323 | |
| 324 | type UTimesCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd# struct { |
| 325 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#Path. string |
| 326 | ATimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#ATime., MTimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#MTime., CTimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#CTime. timescip-go gomod github.com/golang/go/src go1.12 time/.Timescip-go gomod github.com/golang/go/src go1.12 time/Time# |
| 327 | } |
| 328 | |
| 329 | func (c UTimesCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 330 | return sendCmdUtimesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdUtimes. |
| 331 | } |
| 332 | func (c *UTimesCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 333 | for _, tlv := range tlvs { |
| 334 | var ok bool |
| 335 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 336 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 337 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 338 | case sendAttrAtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrAtime.: |
| 339 | c.ATimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#ATime., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(timescip-go gomod github.com/golang/go/src go1.12 time/.Timescip-go gomod github.com/golang/go/src go1.12 time/Time#) |
| 340 | case sendAttrMtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMtime.: |
| 341 | c.MTimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#MTime., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(timescip-go gomod github.com/golang/go/src go1.12 time/.Timescip-go gomod github.com/golang/go/src go1.12 time/Time#) |
| 342 | case sendAttrCtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtime.: |
| 343 | c.CTimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#CTime., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(timescip-go gomod github.com/golang/go/src go1.12 time/.Timescip-go gomod github.com/golang/go/src go1.12 time/Time#) |
| 344 | default: |
| 345 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#Type().()} |
| 346 | } |
| 347 | if !ok { |
| 348 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/UTimesCmd#Type().()} |
| 349 | } |
| 350 | } |
| 351 | return nil |
| 352 | } |
| 353 | |
| 354 | type MkdirCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd# struct { |
| 355 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Path. string |
| 356 | Inoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Ino. uint64 |
| 357 | } |
| 358 | |
| 359 | func (c MkdirCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 360 | return sendCmdMkdirscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkdir. |
| 361 | } |
| 362 | func (c *MkdirCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 363 | for _, tlv := range tlvs { |
| 364 | var ok bool |
| 365 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 366 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 367 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 368 | case sendAttrInoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrIno.: |
| 369 | c.Inoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Ino., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 370 | default: |
| 371 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Type().()} |
| 372 | } |
| 373 | if !ok { |
| 374 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkdirCmd#Type().()} |
| 375 | } |
| 376 | } |
| 377 | return nil |
| 378 | } |
| 379 | |
| 380 | type RenameCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd# struct { |
| 381 | Fromscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#From., Toscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#To. string |
| 382 | } |
| 383 | |
| 384 | func (c RenameCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 385 | return sendCmdRenamescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdRename. |
| 386 | } |
| 387 | func (c *RenameCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 388 | for _, tlv := range tlvs { |
| 389 | var ok bool |
| 390 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 391 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 392 | c.Fromscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#From., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 393 | case sendAttrPathToscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPathTo.: |
| 394 | c.Toscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#To., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 395 | default: |
| 396 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#Type().()} |
| 397 | } |
| 398 | if !ok { |
| 399 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/RenameCmd#Type().()} |
| 400 | } |
| 401 | } |
| 402 | return nil |
| 403 | } |
| 404 | |
| 405 | type MkfileCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd# struct { |
| 406 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Path. string |
| 407 | Inoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Ino. uint64 |
| 408 | } |
| 409 | |
| 410 | func (c MkfileCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 411 | return sendCmdMkfilescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkfile. |
| 412 | } |
| 413 | func (c *MkfileCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 414 | for _, tlv := range tlvs { |
| 415 | var ok bool |
| 416 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 417 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 418 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 419 | case sendAttrInoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrIno.: |
| 420 | c.Inoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Ino., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 421 | default: |
| 422 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Type().()} |
| 423 | } |
| 424 | if !ok { |
| 425 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/MkfileCmd#Type().()} |
| 426 | } |
| 427 | } |
| 428 | return nil |
| 429 | } |
| 430 | |
| 431 | type WriteCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd# struct { |
| 432 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Path. string |
| 433 | Offscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Off. uint64 |
| 434 | Datascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Data. []byte |
| 435 | } |
| 436 | |
| 437 | func (c WriteCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 438 | return sendCmdWritescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdWrite. |
| 439 | } |
| 440 | func (c *WriteCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 441 | for _, tlv := range tlvs { |
| 442 | var ok bool |
| 443 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 444 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 445 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 446 | case sendAttrFileOffsetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrFileOffset.: |
| 447 | c.Offscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Off., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 448 | case sendAttrDatascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrData.: |
| 449 | c.Datascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Data., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..([]byte) |
| 450 | default: |
| 451 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Type().()} |
| 452 | } |
| 453 | if !ok { |
| 454 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/WriteCmd#Type().()} |
| 455 | } |
| 456 | } |
| 457 | return nil |
| 458 | } |
| 459 | |
| 460 | type TruncateCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd# struct { |
| 461 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Path. string |
| 462 | Sizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Size. uint64 |
| 463 | } |
| 464 | |
| 465 | func (c TruncateCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#) Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Type().() CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# { |
| 466 | return sendCmdTruncatescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdTruncate. |
| 467 | } |
| 468 | func (c *TruncateCmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#) decodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#decode().(tlvs []SendTLVscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#) error { |
| 469 | for _, tlv := range tlvs { |
| 470 | var ok bool |
| 471 | switch tlv.Attrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Attr. { |
| 472 | case sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath.: |
| 473 | c.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Path., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(string) |
| 474 | case sendAttrSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrSize.: |
| 475 | c.Sizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Size., ok = tlv.Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/SendTLV#Val..(uint64) |
| 476 | default: |
| 477 | return errUnexpectedAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttr#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Type().()} |
| 478 | } |
| 479 | if !ok { |
| 480 | return errUnexpectedAttrTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#{Valscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Val.: tlv, Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/errUnexpectedAttrType#Cmd.: c.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/TruncateCmd#Type().()} |
| 481 | } |
| 482 | } |
| 483 | return nil |
| 484 | } |