vendor: github.com/tonistiigi/fsutil c2c7d7b0e1441705cd802e5699c0a10b1dfe39fd

full diff: 0f039a052c...c2c7d7b0e1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-04-16 17:15:03 +02:00
parent edf70dc308
commit 2b910b69b3
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
5 changed files with 359 additions and 302 deletions

View File

@ -69,7 +69,7 @@ github.com/spf13/cobra ef82de70bb3f60c65fb8eebacbb2
github.com/spf13/pflag 4cb166e4f25ac4e8016a3595bbf7ea2e9aa85a2c https://github.com/thaJeztah/pflag.git # temporary fork with https://github.com/spf13/pflag/pull/170 applied, which isn't merged yet upstream github.com/spf13/pflag 4cb166e4f25ac4e8016a3595bbf7ea2e9aa85a2c https://github.com/thaJeztah/pflag.git # temporary fork with https://github.com/spf13/pflag/pull/170 applied, which isn't merged yet upstream
github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2 github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2
github.com/theupdateframework/notary d6e1431feb32348e0650bf7551ac5cffd01d857b # v0.6.1 github.com/theupdateframework/notary d6e1431feb32348e0650bf7551ac5cffd01d857b # v0.6.1
github.com/tonistiigi/fsutil 0f039a052ca1da01626278199624b62aed9b3729 github.com/tonistiigi/fsutil c2c7d7b0e1441705cd802e5699c0a10b1dfe39fd
github.com/tonistiigi/units 6950e57a87eaf136bbe44ef2ec8e75b9e3569de2 github.com/tonistiigi/units 6950e57a87eaf136bbe44ef2ec8e75b9e3569de2
github.com/xeipuuv/gojsonpointer 02993c407bfbf5f6dae44c4f4b1cf6a39b5fc5bb github.com/xeipuuv/gojsonpointer 02993c407bfbf5f6dae44c4f4b1cf6a39b5fc5bb
github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b github.com/xeipuuv/gojsonreference bd5ef7bd5415a7ac448318e64f11a24cd21e594b

View File

@ -2,13 +2,11 @@ module github.com/tonistiigi/fsutil
require ( require (
github.com/Microsoft/go-winio v0.4.11 // indirect github.com/Microsoft/go-winio v0.4.11 // indirect
github.com/Microsoft/hcsshim v0.8.5 // indirect
github.com/containerd/containerd v1.2.4
github.com/containerd/continuity v0.0.0-20181001140422-bd77b46c8352 github.com/containerd/continuity v0.0.0-20181001140422-bd77b46c8352
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/docker v0.0.0-20180531152204-71cd53e4a197 github.com/docker/docker v0.0.0-20180531152204-71cd53e4a197
github.com/docker/go-units v0.3.1 // indirect github.com/docker/go-units v0.3.1 // indirect
github.com/gogo/protobuf v1.0.0 github.com/gogo/protobuf v1.3.1
github.com/google/go-cmp v0.2.0 // indirect github.com/google/go-cmp v0.2.0 // indirect
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
github.com/onsi/ginkgo v1.7.0 // indirect github.com/onsi/ginkgo v1.7.0 // indirect
@ -26,3 +24,5 @@ require (
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gotest.tools v2.1.0+incompatible // indirect gotest.tools v2.1.0+incompatible // indirect
) )
go 1.13

View File

@ -37,7 +37,11 @@ func WriteTar(ctx context.Context, fs FS, w io.Writer) error {
hdr.Linkname = stat.Linkname hdr.Linkname = stat.Linkname
if hdr.Linkname != "" { if hdr.Linkname != "" {
hdr.Size = 0 hdr.Size = 0
hdr.Typeflag = tar.TypeLink if fi.Mode() & os.ModeSymlink != 0 {
hdr.Typeflag = tar.TypeSymlink
} else {
hdr.Typeflag = tar.TypeLink
}
} }
if len(stat.Xattrs) > 0 { if len(stat.Xattrs) > 0 {

View File

@ -1,30 +1,19 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT. // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: stat.proto // source: stat.proto
/*
Package types is a generated protocol buffer package.
It is generated from these files:
stat.proto
wire.proto
It has these top-level messages:
Stat
Packet
*/
package types package types
import proto "github.com/gogo/protobuf/proto" import (
import fmt "fmt" bytes "bytes"
import math "math" fmt "fmt"
proto "github.com/gogo/protobuf/proto"
import bytes "bytes" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
io "io"
import strings "strings" math "math"
import reflect "reflect" math_bits "math/bits"
import sortkeys "github.com/gogo/protobuf/sortkeys" reflect "reflect"
strings "strings"
import io "io" )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
@ -35,7 +24,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Stat struct { type Stat struct {
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
@ -48,12 +37,40 @@ type Stat struct {
Linkname string `protobuf:"bytes,7,opt,name=linkname,proto3" json:"linkname,omitempty"` Linkname string `protobuf:"bytes,7,opt,name=linkname,proto3" json:"linkname,omitempty"`
Devmajor int64 `protobuf:"varint,8,opt,name=devmajor,proto3" json:"devmajor,omitempty"` Devmajor int64 `protobuf:"varint,8,opt,name=devmajor,proto3" json:"devmajor,omitempty"`
Devminor int64 `protobuf:"varint,9,opt,name=devminor,proto3" json:"devminor,omitempty"` Devminor int64 `protobuf:"varint,9,opt,name=devminor,proto3" json:"devminor,omitempty"`
Xattrs map[string][]byte `protobuf:"bytes,10,rep,name=xattrs" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Xattrs map[string][]byte `protobuf:"bytes,10,rep,name=xattrs,proto3" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
} }
func (m *Stat) Reset() { *m = Stat{} } func (m *Stat) Reset() { *m = Stat{} }
func (*Stat) ProtoMessage() {} func (*Stat) ProtoMessage() {}
func (*Stat) Descriptor() ([]byte, []int) { return fileDescriptorStat, []int{0} } func (*Stat) Descriptor() ([]byte, []int) {
return fileDescriptor_01fabdc1b78bd68b, []int{0}
}
func (m *Stat) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Stat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Stat.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Stat) XXX_Merge(src proto.Message) {
xxx_messageInfo_Stat.Merge(m, src)
}
func (m *Stat) XXX_Size() int {
return m.Size()
}
func (m *Stat) XXX_DiscardUnknown() {
xxx_messageInfo_Stat.DiscardUnknown(m)
}
var xxx_messageInfo_Stat proto.InternalMessageInfo
func (m *Stat) GetPath() string { func (m *Stat) GetPath() string {
if m != nil { if m != nil {
@ -127,7 +144,35 @@ func (m *Stat) GetXattrs() map[string][]byte {
func init() { func init() {
proto.RegisterType((*Stat)(nil), "fsutil.types.Stat") proto.RegisterType((*Stat)(nil), "fsutil.types.Stat")
proto.RegisterMapType((map[string][]byte)(nil), "fsutil.types.Stat.XattrsEntry")
} }
func init() { proto.RegisterFile("stat.proto", fileDescriptor_01fabdc1b78bd68b) }
var fileDescriptor_01fabdc1b78bd68b = []byte{
// 317 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xbd, 0x4e, 0xc3, 0x30,
0x14, 0x85, 0x73, 0x9b, 0xfe, 0xba, 0x45, 0x42, 0x16, 0x83, 0xd5, 0xe1, 0x2a, 0x62, 0xca, 0x94,
0x01, 0x24, 0xc4, 0xcf, 0x86, 0xc4, 0x0b, 0x04, 0x06, 0xc4, 0x66, 0x64, 0x53, 0x4c, 0x9b, 0xb8,
0x4a, 0xdc, 0x8a, 0x32, 0xf1, 0x08, 0x3c, 0x06, 0x6f, 0x02, 0x63, 0xc7, 0x8e, 0xd4, 0x5d, 0x18,
0xfb, 0x08, 0xc8, 0x4e, 0x5b, 0xba, 0x9d, 0xf3, 0x9d, 0x7b, 0x95, 0x9c, 0x6b, 0x42, 0x4a, 0xc3,
0x4d, 0x32, 0x2e, 0xb4, 0xd1, 0xb4, 0xf7, 0x54, 0x4e, 0x8c, 0x1a, 0x25, 0x66, 0x36, 0x96, 0xe5,
0xf1, 0x57, 0x8d, 0xd4, 0x6f, 0x0d, 0x37, 0x94, 0x92, 0xfa, 0x98, 0x9b, 0x67, 0x06, 0x11, 0xc4,
0x9d, 0xd4, 0x6b, 0xc7, 0x32, 0x2d, 0x24, 0xab, 0x45, 0x10, 0x1f, 0xa4, 0x5e, 0xd3, 0x43, 0x12,
0x4e, 0x94, 0x60, 0xa1, 0x47, 0x4e, 0x3a, 0x32, 0x50, 0x82, 0xd5, 0x2b, 0x32, 0x50, 0xc2, 0xed,
0x95, 0xea, 0x4d, 0xb2, 0x46, 0x04, 0x71, 0x98, 0x7a, 0x4d, 0x19, 0x69, 0x65, 0x5a, 0xdc, 0xa9,
0x4c, 0xb2, 0xa6, 0xc7, 0x5b, 0x4b, 0xfb, 0xa4, 0x3d, 0x52, 0xf9, 0x30, 0xe7, 0x99, 0x64, 0x2d,
0xff, 0xf5, 0x9d, 0x77, 0x99, 0x90, 0xd3, 0x8c, 0xbf, 0xe8, 0x82, 0xb5, 0xfd, 0xda, 0xce, 0x6f,
0x33, 0x95, 0xeb, 0x82, 0x75, 0xfe, 0x33, 0xe7, 0xe9, 0x19, 0x69, 0xbe, 0x72, 0x63, 0x8a, 0x92,
0x91, 0x28, 0x8c, 0xbb, 0x27, 0x98, 0xec, 0xb7, 0x4e, 0x5c, 0xe3, 0xe4, 0xde, 0x0f, 0xdc, 0xe4,
0xa6, 0x98, 0xa5, 0x9b, 0xe9, 0xfe, 0x05, 0xe9, 0xee, 0x61, 0x57, 0x6d, 0x28, 0x67, 0x9b, 0x9b,
0x38, 0x49, 0x8f, 0x48, 0x63, 0xca, 0x47, 0x93, 0xea, 0x26, 0xbd, 0xb4, 0x32, 0x97, 0xb5, 0x73,
0xb8, 0xbe, 0x9a, 0x2f, 0x31, 0x58, 0x2c, 0x31, 0x58, 0x2f, 0x11, 0xde, 0x2d, 0xc2, 0xa7, 0x45,
0xf8, 0xb6, 0x08, 0x73, 0x8b, 0xf0, 0x63, 0x11, 0x7e, 0x2d, 0x06, 0x6b, 0x8b, 0xf0, 0xb1, 0xc2,
0x60, 0xbe, 0xc2, 0x60, 0xb1, 0xc2, 0xe0, 0xa1, 0xe1, 0x7f, 0xe8, 0xb1, 0xe9, 0xdf, 0xe6, 0xf4,
0x2f, 0x00, 0x00, 0xff, 0xff, 0x06, 0x97, 0xf3, 0xd7, 0xa9, 0x01, 0x00, 0x00,
}
func (this *Stat) Equal(that interface{}) bool { func (this *Stat) Equal(that interface{}) bool {
if that == nil { if that == nil {
return this == nil return this == nil
@ -203,7 +248,7 @@ func (this *Stat) GoString() string {
for k, _ := range this.Xattrs { for k, _ := range this.Xattrs {
keysForXattrs = append(keysForXattrs, k) keysForXattrs = append(keysForXattrs, k)
} }
sortkeys.Strings(keysForXattrs) github_com_gogo_protobuf_sortkeys.Strings(keysForXattrs)
mapStringForXattrs := "map[string][]byte{" mapStringForXattrs := "map[string][]byte{"
for _, k := range keysForXattrs { for _, k := range keysForXattrs {
mapStringForXattrs += fmt.Sprintf("%#v: %#v,", k, this.Xattrs[k]) mapStringForXattrs += fmt.Sprintf("%#v: %#v,", k, this.Xattrs[k])
@ -226,7 +271,7 @@ func valueToGoStringStat(v interface{}, typ string) string {
func (m *Stat) Marshal() (dAtA []byte, err error) { func (m *Stat) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -234,93 +279,103 @@ func (m *Stat) Marshal() (dAtA []byte, err error) {
} }
func (m *Stat) MarshalTo(dAtA []byte) (int, error) { func (m *Stat) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Stat) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Path) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintStat(dAtA, i, uint64(len(m.Path)))
i += copy(dAtA[i:], m.Path)
}
if m.Mode != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintStat(dAtA, i, uint64(m.Mode))
}
if m.Uid != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintStat(dAtA, i, uint64(m.Uid))
}
if m.Gid != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintStat(dAtA, i, uint64(m.Gid))
}
if m.Size_ != 0 {
dAtA[i] = 0x28
i++
i = encodeVarintStat(dAtA, i, uint64(m.Size_))
}
if m.ModTime != 0 {
dAtA[i] = 0x30
i++
i = encodeVarintStat(dAtA, i, uint64(m.ModTime))
}
if len(m.Linkname) > 0 {
dAtA[i] = 0x3a
i++
i = encodeVarintStat(dAtA, i, uint64(len(m.Linkname)))
i += copy(dAtA[i:], m.Linkname)
}
if m.Devmajor != 0 {
dAtA[i] = 0x40
i++
i = encodeVarintStat(dAtA, i, uint64(m.Devmajor))
}
if m.Devminor != 0 {
dAtA[i] = 0x48
i++
i = encodeVarintStat(dAtA, i, uint64(m.Devminor))
}
if len(m.Xattrs) > 0 { if len(m.Xattrs) > 0 {
for k, _ := range m.Xattrs { for k := range m.Xattrs {
dAtA[i] = 0x52
i++
v := m.Xattrs[k] v := m.Xattrs[k]
byteSize := 0 baseI := i
if len(v) > 0 { if len(v) > 0 {
byteSize = 1 + len(v) + sovStat(uint64(len(v))) i -= len(v)
} copy(dAtA[i:], v)
mapSize := 1 + len(k) + sovStat(uint64(len(k))) + byteSize
i = encodeVarintStat(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintStat(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
if len(v) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintStat(dAtA, i, uint64(len(v))) i = encodeVarintStat(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v) i--
dAtA[i] = 0x12
} }
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintStat(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintStat(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x52
} }
} }
return i, nil if m.Devminor != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.Devminor))
i--
dAtA[i] = 0x48
}
if m.Devmajor != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.Devmajor))
i--
dAtA[i] = 0x40
}
if len(m.Linkname) > 0 {
i -= len(m.Linkname)
copy(dAtA[i:], m.Linkname)
i = encodeVarintStat(dAtA, i, uint64(len(m.Linkname)))
i--
dAtA[i] = 0x3a
}
if m.ModTime != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.ModTime))
i--
dAtA[i] = 0x30
}
if m.Size_ != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.Size_))
i--
dAtA[i] = 0x28
}
if m.Gid != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.Gid))
i--
dAtA[i] = 0x20
}
if m.Uid != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.Uid))
i--
dAtA[i] = 0x18
}
if m.Mode != 0 {
i = encodeVarintStat(dAtA, i, uint64(m.Mode))
i--
dAtA[i] = 0x10
}
if len(m.Path) > 0 {
i -= len(m.Path)
copy(dAtA[i:], m.Path)
i = encodeVarintStat(dAtA, i, uint64(len(m.Path)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintStat(dAtA []byte, offset int, v uint64) int { func encodeVarintStat(dAtA []byte, offset int, v uint64) int {
offset -= sovStat(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Stat) Size() (n int) { func (m *Stat) Size() (n int) {
if m == nil {
return 0
}
var l int var l int
_ = l _ = l
l = len(m.Path) l = len(m.Path)
@ -368,14 +423,7 @@ func (m *Stat) Size() (n int) {
} }
func sovStat(x uint64) (n int) { func sovStat(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozStat(x uint64) (n int) { func sozStat(x uint64) (n int) {
return sovStat(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovStat(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -388,7 +436,7 @@ func (this *Stat) String() string {
for k, _ := range this.Xattrs { for k, _ := range this.Xattrs {
keysForXattrs = append(keysForXattrs, k) keysForXattrs = append(keysForXattrs, k)
} }
sortkeys.Strings(keysForXattrs) github_com_gogo_protobuf_sortkeys.Strings(keysForXattrs)
mapStringForXattrs := "map[string][]byte{" mapStringForXattrs := "map[string][]byte{"
for _, k := range keysForXattrs { for _, k := range keysForXattrs {
mapStringForXattrs += fmt.Sprintf("%v: %v,", k, this.Xattrs[k]) mapStringForXattrs += fmt.Sprintf("%v: %v,", k, this.Xattrs[k])
@ -432,7 +480,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
wire |= (uint64(b) & 0x7F) << shift wire |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -460,7 +508,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift stringLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -470,6 +518,9 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthStat return ErrInvalidLengthStat
} }
postIndex := iNdEx + intStringLen postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthStat
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -489,7 +540,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Mode |= (uint32(b) & 0x7F) << shift m.Mode |= uint32(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -508,7 +559,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Uid |= (uint32(b) & 0x7F) << shift m.Uid |= uint32(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -527,7 +578,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Gid |= (uint32(b) & 0x7F) << shift m.Gid |= uint32(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -546,7 +597,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Size_ |= (int64(b) & 0x7F) << shift m.Size_ |= int64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -565,7 +616,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.ModTime |= (int64(b) & 0x7F) << shift m.ModTime |= int64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -584,7 +635,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift stringLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -594,6 +645,9 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthStat return ErrInvalidLengthStat
} }
postIndex := iNdEx + intStringLen postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthStat
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -613,7 +667,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Devmajor |= (int64(b) & 0x7F) << shift m.Devmajor |= int64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -632,7 +686,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Devminor |= (int64(b) & 0x7F) << shift m.Devminor |= int64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -651,7 +705,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
msglen |= (int(b) & 0x7F) << shift msglen |= int(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -660,6 +714,9 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthStat return ErrInvalidLengthStat
} }
postIndex := iNdEx + msglen postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthStat
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -680,7 +737,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
wire |= (uint64(b) & 0x7F) << shift wire |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -697,7 +754,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
stringLenmapkey |= (uint64(b) & 0x7F) << shift stringLenmapkey |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -707,6 +764,9 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthStat return ErrInvalidLengthStat
} }
postStringIndexmapkey := iNdEx + intStringLenmapkey postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey < 0 {
return ErrInvalidLengthStat
}
if postStringIndexmapkey > l { if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -723,7 +783,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
mapbyteLen |= (uint64(b) & 0x7F) << shift mapbyteLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -733,6 +793,9 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthStat return ErrInvalidLengthStat
} }
postbytesIndex := iNdEx + intMapbyteLen postbytesIndex := iNdEx + intMapbyteLen
if postbytesIndex < 0 {
return ErrInvalidLengthStat
}
if postbytesIndex > l { if postbytesIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -765,6 +828,9 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
if skippy < 0 { if skippy < 0 {
return ErrInvalidLengthStat return ErrInvalidLengthStat
} }
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthStat
}
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -780,6 +846,7 @@ func (m *Stat) Unmarshal(dAtA []byte) error {
func skipStat(dAtA []byte) (n int, err error) { func skipStat(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -811,10 +878,8 @@ func skipStat(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -831,79 +896,34 @@ func skipStat(dAtA []byte) (n int, err error) {
break break
} }
} }
iNdEx += length
if length < 0 { if length < 0 {
return 0, ErrInvalidLengthStat return 0, ErrInvalidLengthStat
} }
return iNdEx, nil iNdEx += length
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowStat
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipStat(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupStat
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthStat
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthStat = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthStat = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowStat = fmt.Errorf("proto: integer overflow") ErrIntOverflowStat = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupStat = fmt.Errorf("proto: unexpected end of group")
) )
func init() { proto.RegisterFile("stat.proto", fileDescriptorStat) }
var fileDescriptorStat = []byte{
// 310 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xbd, 0x4e, 0xc3, 0x30,
0x14, 0x85, 0x73, 0x9b, 0xfe, 0xba, 0x45, 0x42, 0x16, 0x83, 0xd5, 0xe1, 0x2a, 0x62, 0xca, 0x94,
0x81, 0x4a, 0x08, 0x18, 0x91, 0x78, 0x81, 0xc0, 0x80, 0xd8, 0x8c, 0x6c, 0x8a, 0x69, 0x13, 0x57,
0x89, 0x5b, 0x51, 0x26, 0x1e, 0x81, 0xc7, 0xe0, 0x4d, 0x60, 0xec, 0xc8, 0x48, 0xcc, 0xc2, 0xd8,
0x47, 0x40, 0x76, 0xda, 0xd2, 0xed, 0x9c, 0xef, 0xdc, 0xab, 0xe4, 0x5c, 0x13, 0x52, 0x1a, 0x6e,
0x92, 0x59, 0xa1, 0x8d, 0xa6, 0x83, 0x87, 0x72, 0x6e, 0xd4, 0x34, 0x31, 0xcb, 0x99, 0x2c, 0x8f,
0x3f, 0x1a, 0xa4, 0x79, 0x6d, 0xb8, 0xa1, 0x94, 0x34, 0x67, 0xdc, 0x3c, 0x32, 0x88, 0x20, 0xee,
0xa5, 0x5e, 0x3b, 0x96, 0x69, 0x21, 0x59, 0x23, 0x82, 0xf8, 0x20, 0xf5, 0x9a, 0x1e, 0x92, 0x70,
0xae, 0x04, 0x0b, 0x3d, 0x72, 0xd2, 0x91, 0xb1, 0x12, 0xac, 0x59, 0x93, 0xb1, 0x12, 0x6e, 0xaf,
0x54, 0x2f, 0x92, 0xb5, 0x22, 0x88, 0xc3, 0xd4, 0x6b, 0xca, 0x48, 0x27, 0xd3, 0xe2, 0x46, 0x65,
0x92, 0xb5, 0x3d, 0xde, 0x5a, 0x3a, 0x24, 0xdd, 0xa9, 0xca, 0x27, 0x39, 0xcf, 0x24, 0xeb, 0xf8,
0xaf, 0xef, 0xbc, 0xcb, 0x84, 0x5c, 0x64, 0xfc, 0x49, 0x17, 0xac, 0xeb, 0xd7, 0x76, 0x7e, 0x9b,
0xa9, 0x5c, 0x17, 0xac, 0xf7, 0x9f, 0x39, 0x4f, 0x4f, 0x49, 0xfb, 0x99, 0x1b, 0x53, 0x94, 0x8c,
0x44, 0x61, 0xdc, 0x3f, 0xc1, 0x64, 0xbf, 0x75, 0xe2, 0x1a, 0x27, 0xb7, 0x7e, 0xe0, 0x2a, 0x37,
0xc5, 0x32, 0xdd, 0x4c, 0x0f, 0xcf, 0x49, 0x7f, 0x0f, 0xbb, 0x6a, 0x13, 0xb9, 0xdc, 0xdc, 0xc4,
0x49, 0x7a, 0x44, 0x5a, 0x0b, 0x3e, 0x9d, 0xd7, 0x37, 0x19, 0xa4, 0xb5, 0xb9, 0x68, 0x9c, 0xc1,
0xe5, 0x68, 0x55, 0x61, 0xf0, 0x55, 0x61, 0xb0, 0xae, 0x10, 0x5e, 0x2d, 0xc2, 0xbb, 0x45, 0xf8,
0xb4, 0x08, 0x2b, 0x8b, 0xf0, 0x6d, 0x11, 0x7e, 0x2d, 0x06, 0x6b, 0x8b, 0xf0, 0xf6, 0x83, 0xc1,
0x5d, 0xcb, 0xff, 0xc8, 0x7d, 0xdb, 0xbf, 0xc9, 0xe8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x90, 0xc2,
0xcf, 0x79, 0xa1, 0x01, 0x00, 0x00,
}

View File

@ -3,24 +3,29 @@
package types package types
import proto "github.com/gogo/protobuf/proto" import (
import fmt "fmt" bytes "bytes"
import math "math" fmt "fmt"
proto "github.com/gogo/protobuf/proto"
import strconv "strconv" io "io"
math "math"
import bytes "bytes" math_bits "math/bits"
reflect "reflect"
import strings "strings" strconv "strconv"
import reflect "reflect" strings "strings"
)
import io "io"
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Packet_PacketType int32 type Packet_PacketType int32
const ( const (
@ -38,6 +43,7 @@ var Packet_PacketType_name = map[int32]string{
3: "PACKET_FIN", 3: "PACKET_FIN",
4: "PACKET_ERR", 4: "PACKET_ERR",
} }
var Packet_PacketType_value = map[string]int32{ var Packet_PacketType_value = map[string]int32{
"PACKET_STAT": 0, "PACKET_STAT": 0,
"PACKET_REQ": 1, "PACKET_REQ": 1,
@ -46,18 +52,48 @@ var Packet_PacketType_value = map[string]int32{
"PACKET_ERR": 4, "PACKET_ERR": 4,
} }
func (Packet_PacketType) EnumDescriptor() ([]byte, []int) { return fileDescriptorWire, []int{0, 0} } func (Packet_PacketType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_f2dcdddcdf68d8e0, []int{0, 0}
}
type Packet struct { type Packet struct {
Type Packet_PacketType `protobuf:"varint,1,opt,name=type,proto3,enum=fsutil.types.Packet_PacketType" json:"type,omitempty"` Type Packet_PacketType `protobuf:"varint,1,opt,name=type,proto3,enum=fsutil.types.Packet_PacketType" json:"type,omitempty"`
Stat *Stat `protobuf:"bytes,2,opt,name=stat" json:"stat,omitempty"` Stat *Stat `protobuf:"bytes,2,opt,name=stat,proto3" json:"stat,omitempty"`
ID uint32 `protobuf:"varint,3,opt,name=ID,proto3" json:"ID,omitempty"` ID uint32 `protobuf:"varint,3,opt,name=ID,proto3" json:"ID,omitempty"`
Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
} }
func (m *Packet) Reset() { *m = Packet{} } func (m *Packet) Reset() { *m = Packet{} }
func (*Packet) ProtoMessage() {} func (*Packet) ProtoMessage() {}
func (*Packet) Descriptor() ([]byte, []int) { return fileDescriptorWire, []int{0} } func (*Packet) Descriptor() ([]byte, []int) {
return fileDescriptor_f2dcdddcdf68d8e0, []int{0}
}
func (m *Packet) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Packet.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Packet) XXX_Merge(src proto.Message) {
xxx_messageInfo_Packet.Merge(m, src)
}
func (m *Packet) XXX_Size() int {
return m.Size()
}
func (m *Packet) XXX_DiscardUnknown() {
xxx_messageInfo_Packet.DiscardUnknown(m)
}
var xxx_messageInfo_Packet proto.InternalMessageInfo
func (m *Packet) GetType() Packet_PacketType { func (m *Packet) GetType() Packet_PacketType {
if m != nil { if m != nil {
@ -88,9 +124,34 @@ func (m *Packet) GetData() []byte {
} }
func init() { func init() {
proto.RegisterType((*Packet)(nil), "fsutil.types.Packet")
proto.RegisterEnum("fsutil.types.Packet_PacketType", Packet_PacketType_name, Packet_PacketType_value) proto.RegisterEnum("fsutil.types.Packet_PacketType", Packet_PacketType_name, Packet_PacketType_value)
proto.RegisterType((*Packet)(nil), "fsutil.types.Packet")
} }
func init() { proto.RegisterFile("wire.proto", fileDescriptor_f2dcdddcdf68d8e0) }
var fileDescriptor_f2dcdddcdf68d8e0 = []byte{
// 276 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xcf, 0x2c, 0x4a,
0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x49, 0x2b, 0x2e, 0x2d, 0xc9, 0xcc, 0xd1, 0x2b,
0xa9, 0x2c, 0x48, 0x2d, 0x96, 0xe2, 0x2a, 0x2e, 0x49, 0x2c, 0x81, 0xc8, 0x28, 0xbd, 0x64, 0xe4,
0x62, 0x0b, 0x48, 0x4c, 0xce, 0x4e, 0x2d, 0x11, 0x32, 0xe6, 0x62, 0x01, 0xc9, 0x4b, 0x30, 0x2a,
0x30, 0x6a, 0xf0, 0x19, 0xc9, 0xeb, 0x21, 0xeb, 0xd1, 0x83, 0xa8, 0x81, 0x52, 0x21, 0x95, 0x05,
0xa9, 0x41, 0x60, 0xc5, 0x42, 0x6a, 0x5c, 0x2c, 0x20, 0xd3, 0x24, 0x98, 0x14, 0x18, 0x35, 0xb8,
0x8d, 0x84, 0x50, 0x35, 0x05, 0x97, 0x24, 0x96, 0x04, 0x81, 0xe5, 0x85, 0xf8, 0xb8, 0x98, 0x3c,
0x5d, 0x24, 0x98, 0x15, 0x18, 0x35, 0x78, 0x83, 0x98, 0x3c, 0x5d, 0x84, 0x84, 0xb8, 0x58, 0x52,
0x12, 0x4b, 0x12, 0x25, 0x58, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0xa5, 0x38, 0x2e, 0x2e,
0x84, 0xf9, 0x42, 0xfc, 0x5c, 0xdc, 0x01, 0x8e, 0xce, 0xde, 0xae, 0x21, 0xf1, 0xc1, 0x21, 0x8e,
0x21, 0x02, 0x0c, 0x42, 0x7c, 0x5c, 0x5c, 0x50, 0x81, 0x20, 0xd7, 0x40, 0x01, 0x46, 0x24, 0x05,
0x2e, 0x8e, 0x21, 0x8e, 0x02, 0x4c, 0x48, 0x0a, 0xdc, 0x3c, 0xfd, 0x04, 0x98, 0x91, 0xf8, 0xae,
0x41, 0x41, 0x02, 0x2c, 0x4e, 0xd6, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1,
0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc,
0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63,
0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x58, 0xc1,
0x7e, 0x49, 0x62, 0x03, 0x87, 0x97, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x9d, 0xe3, 0x51,
0x57, 0x01, 0x00, 0x00,
}
func (x Packet_PacketType) String() string { func (x Packet_PacketType) String() string {
s, ok := Packet_PacketType_name[int32(x)] s, ok := Packet_PacketType_name[int32(x)]
if ok { if ok {
@ -157,7 +218,7 @@ func valueToGoStringWire(v interface{}, typ string) string {
func (m *Packet) Marshal() (dAtA []byte, err error) { func (m *Packet) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -165,49 +226,62 @@ func (m *Packet) Marshal() (dAtA []byte, err error) {
} }
func (m *Packet) MarshalTo(dAtA []byte) (int, error) { func (m *Packet) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Type != 0 { if len(m.Data) > 0 {
dAtA[i] = 0x8 i -= len(m.Data)
i++ copy(dAtA[i:], m.Data)
i = encodeVarintWire(dAtA, i, uint64(m.Type)) i = encodeVarintWire(dAtA, i, uint64(len(m.Data)))
} i--
if m.Stat != nil { dAtA[i] = 0x22
dAtA[i] = 0x12
i++
i = encodeVarintWire(dAtA, i, uint64(m.Stat.Size()))
n1, err := m.Stat.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
} }
if m.ID != 0 { if m.ID != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintWire(dAtA, i, uint64(m.ID)) i = encodeVarintWire(dAtA, i, uint64(m.ID))
i--
dAtA[i] = 0x18
} }
if len(m.Data) > 0 { if m.Stat != nil {
dAtA[i] = 0x22 {
i++ size, err := m.Stat.MarshalToSizedBuffer(dAtA[:i])
i = encodeVarintWire(dAtA, i, uint64(len(m.Data))) if err != nil {
i += copy(dAtA[i:], m.Data) return 0, err
}
i -= size
i = encodeVarintWire(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
} }
return i, nil if m.Type != 0 {
i = encodeVarintWire(dAtA, i, uint64(m.Type))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
} }
func encodeVarintWire(dAtA []byte, offset int, v uint64) int { func encodeVarintWire(dAtA []byte, offset int, v uint64) int {
offset -= sovWire(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Packet) Size() (n int) { func (m *Packet) Size() (n int) {
if m == nil {
return 0
}
var l int var l int
_ = l _ = l
if m.Type != 0 { if m.Type != 0 {
@ -228,14 +302,7 @@ func (m *Packet) Size() (n int) {
} }
func sovWire(x uint64) (n int) { func sovWire(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozWire(x uint64) (n int) { func sozWire(x uint64) (n int) {
return sovWire(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovWire(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@ -276,7 +343,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
wire |= (uint64(b) & 0x7F) << shift wire |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -304,7 +371,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.Type |= (Packet_PacketType(b) & 0x7F) << shift m.Type |= Packet_PacketType(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -323,7 +390,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
msglen |= (int(b) & 0x7F) << shift msglen |= int(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -332,6 +399,9 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthWire return ErrInvalidLengthWire
} }
postIndex := iNdEx + msglen postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthWire
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -356,7 +426,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
m.ID |= (uint32(b) & 0x7F) << shift m.ID |= uint32(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -375,7 +445,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
byteLen |= (int(b) & 0x7F) << shift byteLen |= int(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
@ -384,6 +454,9 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthWire return ErrInvalidLengthWire
} }
postIndex := iNdEx + byteLen postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthWire
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -401,6 +474,9 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
if skippy < 0 { if skippy < 0 {
return ErrInvalidLengthWire return ErrInvalidLengthWire
} }
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthWire
}
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
@ -416,6 +492,7 @@ func (m *Packet) Unmarshal(dAtA []byte) error {
func skipWire(dAtA []byte) (n int, err error) { func skipWire(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -447,10 +524,8 @@ func skipWire(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -467,76 +542,34 @@ func skipWire(dAtA []byte) (n int, err error) {
break break
} }
} }
iNdEx += length
if length < 0 { if length < 0 {
return 0, ErrInvalidLengthWire return 0, ErrInvalidLengthWire
} }
return iNdEx, nil iNdEx += length
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowWire
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipWire(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupWire
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthWire
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthWire = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthWire = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowWire = fmt.Errorf("proto: integer overflow") ErrIntOverflowWire = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupWire = fmt.Errorf("proto: unexpected end of group")
) )
func init() { proto.RegisterFile("wire.proto", fileDescriptorWire) }
var fileDescriptorWire = []byte{
// 268 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xcf, 0x2c, 0x4a,
0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x49, 0x2b, 0x2e, 0x2d, 0xc9, 0xcc, 0xd1, 0x2b,
0xa9, 0x2c, 0x48, 0x2d, 0x96, 0xe2, 0x2a, 0x2e, 0x49, 0x2c, 0x81, 0xc8, 0x28, 0xbd, 0x64, 0xe4,
0x62, 0x0b, 0x48, 0x4c, 0xce, 0x4e, 0x2d, 0x11, 0x32, 0xe6, 0x62, 0x01, 0xc9, 0x4b, 0x30, 0x2a,
0x30, 0x6a, 0xf0, 0x19, 0xc9, 0xeb, 0x21, 0xeb, 0xd1, 0x83, 0xa8, 0x81, 0x52, 0x21, 0x95, 0x05,
0xa9, 0x41, 0x60, 0xc5, 0x42, 0x6a, 0x5c, 0x2c, 0x20, 0xd3, 0x24, 0x98, 0x14, 0x18, 0x35, 0xb8,
0x8d, 0x84, 0x50, 0x35, 0x05, 0x97, 0x24, 0x96, 0x04, 0x81, 0xe5, 0x85, 0xf8, 0xb8, 0x98, 0x3c,
0x5d, 0x24, 0x98, 0x15, 0x18, 0x35, 0x78, 0x83, 0x98, 0x3c, 0x5d, 0x84, 0x84, 0xb8, 0x58, 0x52,
0x12, 0x4b, 0x12, 0x25, 0x58, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0xa5, 0x38, 0x2e, 0x2e,
0x84, 0xf9, 0x42, 0xfc, 0x5c, 0xdc, 0x01, 0x8e, 0xce, 0xde, 0xae, 0x21, 0xf1, 0xc1, 0x21, 0x8e,
0x21, 0x02, 0x0c, 0x42, 0x7c, 0x5c, 0x5c, 0x50, 0x81, 0x20, 0xd7, 0x40, 0x01, 0x46, 0x24, 0x05,
0x2e, 0x8e, 0x21, 0x8e, 0x02, 0x4c, 0x48, 0x0a, 0xdc, 0x3c, 0xfd, 0x04, 0x98, 0x91, 0xf8, 0xae,
0x41, 0x41, 0x02, 0x2c, 0x4e, 0xc6, 0x17, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1,
0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc,
0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63,
0x9c, 0xf0, 0x58, 0x8e, 0x21, 0x8a, 0x15, 0xec, 0x87, 0x24, 0x36, 0x70, 0x38, 0x19, 0x03, 0x02,
0x00, 0x00, 0xff, 0xff, 0xce, 0x0f, 0xe2, 0x94, 0x4f, 0x01, 0x00, 0x00,
}