unixfs.pb.go 2.71 KB
Newer Older
1 2
// Code generated by protoc-gen-gogo.
// source: unixfs.proto
3 4 5
// DO NOT EDIT!

/*
6
Package unixfs_pb is a generated protocol buffer package.
7 8

It is generated from these files:
9
	unixfs.proto
10 11

It has these top-level messages:
12
	Data
13
	Metadata
14
*/
15
package unixfs_pb
16

17
import proto "code.google.com/p/gogoprotobuf/proto"
18 19 20 21 22 23
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = math.Inf

24
type Data_DataType int32
25 26

const (
27 28 29
	Data_Raw       Data_DataType = 0
	Data_Directory Data_DataType = 1
	Data_File      Data_DataType = 2
30
	Data_Metadata  Data_DataType = 3
31 32
)

33
var Data_DataType_name = map[int32]string{
34 35 36
	0: "Raw",
	1: "Directory",
	2: "File",
37
	3: "Metadata",
38
}
39
var Data_DataType_value = map[string]int32{
40 41 42
	"Raw":       0,
	"Directory": 1,
	"File":      2,
43
	"Metadata":  3,
44 45
}

46 47
func (x Data_DataType) Enum() *Data_DataType {
	p := new(Data_DataType)
48 49 50
	*p = x
	return p
}
51 52
func (x Data_DataType) String() string {
	return proto.EnumName(Data_DataType_name, int32(x))
53
}
54 55
func (x *Data_DataType) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(Data_DataType_value, data, "Data_DataType")
56 57 58
	if err != nil {
		return err
	}
59
	*x = Data_DataType(value)
60 61 62
	return nil
}

63 64 65 66 67 68
type Data struct {
	Type             *Data_DataType `protobuf:"varint,1,req,enum=unixfs.pb.Data_DataType" json:"Type,omitempty"`
	Data             []byte         `protobuf:"bytes,2,opt" json:"Data,omitempty"`
	Filesize         *uint64        `protobuf:"varint,3,opt,name=filesize" json:"filesize,omitempty"`
	Blocksizes       []uint64       `protobuf:"varint,4,rep,name=blocksizes" json:"blocksizes,omitempty"`
	XXX_unrecognized []byte         `json:"-"`
69 70
}

71 72 73
func (m *Data) Reset()         { *m = Data{} }
func (m *Data) String() string { return proto.CompactTextString(m) }
func (*Data) ProtoMessage()    {}
74

75
func (m *Data) GetType() Data_DataType {
76 77 78
	if m != nil && m.Type != nil {
		return *m.Type
	}
79
	return Data_Raw
80 81
}

82
func (m *Data) GetData() []byte {
83 84 85 86 87 88
	if m != nil {
		return m.Data
	}
	return nil
}

89
func (m *Data) GetFilesize() uint64 {
Jeromy's avatar
Jeromy committed
90 91 92 93 94 95
	if m != nil && m.Filesize != nil {
		return *m.Filesize
	}
	return 0
}

96
func (m *Data) GetBlocksizes() []uint64 {
97 98 99 100 101 102
	if m != nil {
		return m.Blocksizes
	}
	return nil
}

103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
type Metadata struct {
	MimeType         *string `protobuf:"bytes,1,req" json:"MimeType,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *Metadata) Reset()         { *m = Metadata{} }
func (m *Metadata) String() string { return proto.CompactTextString(m) }
func (*Metadata) ProtoMessage()    {}

func (m *Metadata) GetMimeType() string {
	if m != nil && m.MimeType != nil {
		return *m.MimeType
	}
	return ""
}

119
func init() {
120
	proto.RegisterEnum("unixfs.pb.Data_DataType", Data_DataType_name, Data_DataType_value)
121
}