github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/plugins/shared/structs/proto/attribute.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: plugins/shared/structs/proto/attribute.proto 3 4 package proto 5 6 import proto "github.com/golang/protobuf/proto" 7 import fmt "fmt" 8 import math "math" 9 10 // Reference imports to suppress errors if they are not otherwise used. 11 var _ = proto.Marshal 12 var _ = fmt.Errorf 13 var _ = math.Inf 14 15 // This is a compile-time assertion to ensure that this generated file 16 // is compatible with the proto package it is being compiled against. 17 // A compilation error at this line likely means your copy of the 18 // proto package needs to be updated. 19 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 20 21 // Attribute is used to describe the value of an attribute, optionally 22 // specifying units 23 type Attribute struct { 24 // Types that are valid to be assigned to Value: 25 // *Attribute_FloatVal 26 // *Attribute_IntVal 27 // *Attribute_StringVal 28 // *Attribute_BoolVal 29 Value isAttribute_Value `protobuf_oneof:"value"` 30 // unit gives the unit type: MHz, MB, etc. 31 Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` 32 XXX_NoUnkeyedLiteral struct{} `json:"-"` 33 XXX_unrecognized []byte `json:"-"` 34 XXX_sizecache int32 `json:"-"` 35 } 36 37 func (m *Attribute) Reset() { *m = Attribute{} } 38 func (m *Attribute) String() string { return proto.CompactTextString(m) } 39 func (*Attribute) ProtoMessage() {} 40 func (*Attribute) Descriptor() ([]byte, []int) { 41 return fileDescriptor_attribute_aa187fb710a98f5a, []int{0} 42 } 43 func (m *Attribute) XXX_Unmarshal(b []byte) error { 44 return xxx_messageInfo_Attribute.Unmarshal(m, b) 45 } 46 func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 47 return xxx_messageInfo_Attribute.Marshal(b, m, deterministic) 48 } 49 func (dst *Attribute) XXX_Merge(src proto.Message) { 50 xxx_messageInfo_Attribute.Merge(dst, src) 51 } 52 func (m *Attribute) XXX_Size() int { 53 return xxx_messageInfo_Attribute.Size(m) 54 } 55 func (m *Attribute) XXX_DiscardUnknown() { 56 xxx_messageInfo_Attribute.DiscardUnknown(m) 57 } 58 59 var xxx_messageInfo_Attribute proto.InternalMessageInfo 60 61 type isAttribute_Value interface { 62 isAttribute_Value() 63 } 64 65 type Attribute_FloatVal struct { 66 FloatVal float64 `protobuf:"fixed64,1,opt,name=float_val,json=floatVal,proto3,oneof"` 67 } 68 69 type Attribute_IntVal struct { 70 IntVal int64 `protobuf:"varint,2,opt,name=int_val,json=intVal,proto3,oneof"` 71 } 72 73 type Attribute_StringVal struct { 74 StringVal string `protobuf:"bytes,3,opt,name=string_val,json=stringVal,proto3,oneof"` 75 } 76 77 type Attribute_BoolVal struct { 78 BoolVal bool `protobuf:"varint,4,opt,name=bool_val,json=boolVal,proto3,oneof"` 79 } 80 81 func (*Attribute_FloatVal) isAttribute_Value() {} 82 83 func (*Attribute_IntVal) isAttribute_Value() {} 84 85 func (*Attribute_StringVal) isAttribute_Value() {} 86 87 func (*Attribute_BoolVal) isAttribute_Value() {} 88 89 func (m *Attribute) GetValue() isAttribute_Value { 90 if m != nil { 91 return m.Value 92 } 93 return nil 94 } 95 96 func (m *Attribute) GetFloatVal() float64 { 97 if x, ok := m.GetValue().(*Attribute_FloatVal); ok { 98 return x.FloatVal 99 } 100 return 0 101 } 102 103 func (m *Attribute) GetIntVal() int64 { 104 if x, ok := m.GetValue().(*Attribute_IntVal); ok { 105 return x.IntVal 106 } 107 return 0 108 } 109 110 func (m *Attribute) GetStringVal() string { 111 if x, ok := m.GetValue().(*Attribute_StringVal); ok { 112 return x.StringVal 113 } 114 return "" 115 } 116 117 func (m *Attribute) GetBoolVal() bool { 118 if x, ok := m.GetValue().(*Attribute_BoolVal); ok { 119 return x.BoolVal 120 } 121 return false 122 } 123 124 func (m *Attribute) GetUnit() string { 125 if m != nil { 126 return m.Unit 127 } 128 return "" 129 } 130 131 // XXX_OneofFuncs is for the internal use of the proto package. 132 func (*Attribute) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 133 return _Attribute_OneofMarshaler, _Attribute_OneofUnmarshaler, _Attribute_OneofSizer, []interface{}{ 134 (*Attribute_FloatVal)(nil), 135 (*Attribute_IntVal)(nil), 136 (*Attribute_StringVal)(nil), 137 (*Attribute_BoolVal)(nil), 138 } 139 } 140 141 func _Attribute_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 142 m := msg.(*Attribute) 143 // value 144 switch x := m.Value.(type) { 145 case *Attribute_FloatVal: 146 b.EncodeVarint(1<<3 | proto.WireFixed64) 147 b.EncodeFixed64(math.Float64bits(x.FloatVal)) 148 case *Attribute_IntVal: 149 b.EncodeVarint(2<<3 | proto.WireVarint) 150 b.EncodeVarint(uint64(x.IntVal)) 151 case *Attribute_StringVal: 152 b.EncodeVarint(3<<3 | proto.WireBytes) 153 b.EncodeStringBytes(x.StringVal) 154 case *Attribute_BoolVal: 155 t := uint64(0) 156 if x.BoolVal { 157 t = 1 158 } 159 b.EncodeVarint(4<<3 | proto.WireVarint) 160 b.EncodeVarint(t) 161 case nil: 162 default: 163 return fmt.Errorf("Attribute.Value has unexpected type %T", x) 164 } 165 return nil 166 } 167 168 func _Attribute_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 169 m := msg.(*Attribute) 170 switch tag { 171 case 1: // value.float_val 172 if wire != proto.WireFixed64 { 173 return true, proto.ErrInternalBadWireType 174 } 175 x, err := b.DecodeFixed64() 176 m.Value = &Attribute_FloatVal{math.Float64frombits(x)} 177 return true, err 178 case 2: // value.int_val 179 if wire != proto.WireVarint { 180 return true, proto.ErrInternalBadWireType 181 } 182 x, err := b.DecodeVarint() 183 m.Value = &Attribute_IntVal{int64(x)} 184 return true, err 185 case 3: // value.string_val 186 if wire != proto.WireBytes { 187 return true, proto.ErrInternalBadWireType 188 } 189 x, err := b.DecodeStringBytes() 190 m.Value = &Attribute_StringVal{x} 191 return true, err 192 case 4: // value.bool_val 193 if wire != proto.WireVarint { 194 return true, proto.ErrInternalBadWireType 195 } 196 x, err := b.DecodeVarint() 197 m.Value = &Attribute_BoolVal{x != 0} 198 return true, err 199 default: 200 return false, nil 201 } 202 } 203 204 func _Attribute_OneofSizer(msg proto.Message) (n int) { 205 m := msg.(*Attribute) 206 // value 207 switch x := m.Value.(type) { 208 case *Attribute_FloatVal: 209 n += 1 // tag and wire 210 n += 8 211 case *Attribute_IntVal: 212 n += 1 // tag and wire 213 n += proto.SizeVarint(uint64(x.IntVal)) 214 case *Attribute_StringVal: 215 n += 1 // tag and wire 216 n += proto.SizeVarint(uint64(len(x.StringVal))) 217 n += len(x.StringVal) 218 case *Attribute_BoolVal: 219 n += 1 // tag and wire 220 n += 1 221 case nil: 222 default: 223 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 224 } 225 return n 226 } 227 228 func init() { 229 proto.RegisterType((*Attribute)(nil), "hashicorp.nomad.plugins.shared.structs.Attribute") 230 } 231 232 func init() { 233 proto.RegisterFile("plugins/shared/structs/proto/attribute.proto", fileDescriptor_attribute_aa187fb710a98f5a) 234 } 235 236 var fileDescriptor_attribute_aa187fb710a98f5a = []byte{ 237 // 218 bytes of a gzipped FileDescriptorProto 238 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x8f, 0xb1, 0x4e, 0xc3, 0x30, 239 0x10, 0x40, 0x63, 0xda, 0x34, 0xc9, 0x8d, 0x99, 0x8a, 0x10, 0x22, 0x62, 0x40, 0x19, 0x90, 0x33, 240 0xf0, 0x05, 0x74, 0xf2, 0xec, 0x81, 0x81, 0x05, 0x5d, 0xda, 0xd0, 0x58, 0x32, 0x76, 0x64, 0x9f, 241 0xfb, 0x3d, 0x7c, 0x2a, 0xf2, 0x25, 0x4c, 0xf6, 0xbd, 0x77, 0x6f, 0x38, 0x78, 0x5d, 0x6c, 0xba, 242 0x1a, 0x17, 0x87, 0x38, 0x63, 0x98, 0x2e, 0x43, 0xa4, 0x90, 0xce, 0x14, 0x87, 0x25, 0x78, 0xf2, 243 0x03, 0x12, 0x05, 0x33, 0x26, 0x9a, 0x24, 0xcf, 0xed, 0xcb, 0x8c, 0x71, 0x36, 0x67, 0x1f, 0x16, 244 0xe9, 0xfc, 0x0f, 0x5e, 0xe4, 0x56, 0xcb, 0xb5, 0x96, 0x5b, 0xfd, 0xfc, 0x2b, 0xa0, 0x79, 0xff, 245 0x6f, 0xdb, 0x47, 0x68, 0xbe, 0xad, 0x47, 0xfa, 0xba, 0xa1, 0x3d, 0x8a, 0x4e, 0xf4, 0x42, 0x15, 246 0xba, 0x66, 0xf4, 0x81, 0xb6, 0xbd, 0x87, 0xca, 0xb8, 0x55, 0xde, 0x75, 0xa2, 0xdf, 0xa9, 0x42, 247 0x1f, 0x8c, 0x63, 0xf5, 0x04, 0x10, 0x29, 0x18, 0x77, 0x65, 0xbb, 0xeb, 0x44, 0xdf, 0xa8, 0x42, 248 0x37, 0x2b, 0xcb, 0x0b, 0x0f, 0x50, 0x8f, 0xde, 0x5b, 0xd6, 0xfb, 0x4e, 0xf4, 0xb5, 0x2a, 0x74, 249 0x95, 0x49, 0x96, 0x2d, 0xec, 0x93, 0x33, 0x74, 0x2c, 0x73, 0xa7, 0xf9, 0x7f, 0xaa, 0xa0, 0xbc, 250 0xa1, 0x4d, 0xd3, 0xa9, 0xfa, 0x2c, 0xf9, 0xa6, 0xf1, 0xc0, 0xcf, 0xdb, 0x5f, 0x00, 0x00, 0x00, 251 0xff, 0xff, 0x77, 0x2b, 0x7a, 0x7c, 0x0a, 0x01, 0x00, 0x00, 252 }