github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/plugins/shared/hclspec/hcl_spec.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: plugins/shared/hclspec/hcl_spec.proto 3 4 // Spec allows exposing the specification for an HCL body, allowing for parsing and 5 //validation. 6 // 7 //Certain expressions within a specification may use the following functions. 8 //The documentation for each spec type above specifies where functions may 9 //be used. 10 // 11 // `abs(number)` returns the absolute (positive) value of the given number. 12 // `coalesce(vals...)` returns the first non-null value given. 13 // `concat(lists...)` concatenates together all of the given lists to produce a new list. 14 // `hasindex(val, idx)` returns true if the expression `val[idx]` could succeed. 15 // `int(number)` returns the integer portion of the given number, rounding towards zero. 16 // `jsondecode(str)` interprets the given string as JSON and returns the resulting data structure. 17 // `jsonencode(val)` returns a JSON-serialized version of the given value. 18 // `length(collection)` returns the number of elements in the given collection (list, set, map, object, or tuple). 19 // `lower(string)` returns the given string with all uppercase letters converted to lowercase. 20 // `max(numbers...)` returns the greatest of the given numbers. 21 // `min(numbers...)` returns the smallest of the given numbers. 22 // `reverse(string)` returns the given string with all of the characters in reverse order. 23 // `strlen(string)` returns the number of characters in the given string. 24 // `substr(string, offset, length)` returns the requested substring of the given string. 25 // `upper(string)` returns the given string with all lowercase letters converted to uppercase. 26 // 27 //## Type Expressions 28 // 29 //Type expressions are used to describe the expected type of an attribute, as 30 //an additional validation constraint. 31 // 32 //A type expression uses primitive type names and compound type constructors. 33 //A type constructor builds a new type based on one or more type expression 34 //arguments. 35 // 36 //The following type names and type constructors are supported: 37 // 38 // `any` is a wildcard that accepts a value of any type. (In HCL terms, this 39 //is the _dynamic pseudo-type_.) 40 // `string` is a Unicode string. 41 // `number` is an arbitrary-precision floating point number. 42 // `bool` is a boolean value (`true` or `false`) 43 // `list(element_type)` constructs a list type with the given element type 44 // `set(element_type)` constructs a set type with the given element type 45 // `map(element_type)` constructs a map type with the given element type 46 // `object({name1 = element_type, name2 = element_type, ...})` constructs 47 //an object type with the given attribute types. 48 // `tuple([element_type, element_type, ...])` constructs a tuple type with 49 //the given element types. This can be used, for example, to require an 50 //array with a particular number of elements, or with elements of different 51 //types. 52 // 53 //`null` is a valid value of any type, and not a type itself. 54 55 package hclspec 56 57 import ( 58 fmt "fmt" 59 proto "github.com/golang/protobuf/proto" 60 math "math" 61 ) 62 63 // Reference imports to suppress errors if they are not otherwise used. 64 var _ = proto.Marshal 65 var _ = fmt.Errorf 66 var _ = math.Inf 67 68 // This is a compile-time assertion to ensure that this generated file 69 // is compatible with the proto package it is being compiled against. 70 // A compilation error at this line likely means your copy of the 71 // proto package needs to be updated. 72 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 73 74 // Spec defines the available specification types. 75 type Spec struct { 76 // Types that are valid to be assigned to Block: 77 // *Spec_Object 78 // *Spec_Array 79 // *Spec_Attr 80 // *Spec_BlockValue 81 // *Spec_BlockAttrs 82 // *Spec_BlockList 83 // *Spec_BlockSet 84 // *Spec_BlockMap 85 // *Spec_Default 86 // *Spec_Literal 87 Block isSpec_Block `protobuf_oneof:"block"` 88 XXX_NoUnkeyedLiteral struct{} `json:"-"` 89 XXX_unrecognized []byte `json:"-"` 90 XXX_sizecache int32 `json:"-"` 91 } 92 93 func (m *Spec) Reset() { *m = Spec{} } 94 func (m *Spec) String() string { return proto.CompactTextString(m) } 95 func (*Spec) ProtoMessage() {} 96 func (*Spec) Descriptor() ([]byte, []int) { 97 return fileDescriptor_28863966909039be, []int{0} 98 } 99 100 func (m *Spec) XXX_Unmarshal(b []byte) error { 101 return xxx_messageInfo_Spec.Unmarshal(m, b) 102 } 103 func (m *Spec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 104 return xxx_messageInfo_Spec.Marshal(b, m, deterministic) 105 } 106 func (m *Spec) XXX_Merge(src proto.Message) { 107 xxx_messageInfo_Spec.Merge(m, src) 108 } 109 func (m *Spec) XXX_Size() int { 110 return xxx_messageInfo_Spec.Size(m) 111 } 112 func (m *Spec) XXX_DiscardUnknown() { 113 xxx_messageInfo_Spec.DiscardUnknown(m) 114 } 115 116 var xxx_messageInfo_Spec proto.InternalMessageInfo 117 118 type isSpec_Block interface { 119 isSpec_Block() 120 } 121 122 type Spec_Object struct { 123 Object *Object `protobuf:"bytes,1,opt,name=object,proto3,oneof"` 124 } 125 126 type Spec_Array struct { 127 Array *Array `protobuf:"bytes,2,opt,name=array,proto3,oneof"` 128 } 129 130 type Spec_Attr struct { 131 Attr *Attr `protobuf:"bytes,3,opt,name=Attr,proto3,oneof"` 132 } 133 134 type Spec_BlockValue struct { 135 BlockValue *Block `protobuf:"bytes,4,opt,name=block_value,json=blockValue,proto3,oneof"` 136 } 137 138 type Spec_BlockAttrs struct { 139 BlockAttrs *BlockAttrs `protobuf:"bytes,5,opt,name=block_attrs,json=blockAttrs,proto3,oneof"` 140 } 141 142 type Spec_BlockList struct { 143 BlockList *BlockList `protobuf:"bytes,6,opt,name=block_list,json=blockList,proto3,oneof"` 144 } 145 146 type Spec_BlockSet struct { 147 BlockSet *BlockSet `protobuf:"bytes,7,opt,name=block_set,json=blockSet,proto3,oneof"` 148 } 149 150 type Spec_BlockMap struct { 151 BlockMap *BlockMap `protobuf:"bytes,8,opt,name=block_map,json=blockMap,proto3,oneof"` 152 } 153 154 type Spec_Default struct { 155 Default *Default `protobuf:"bytes,9,opt,name=default,proto3,oneof"` 156 } 157 158 type Spec_Literal struct { 159 Literal *Literal `protobuf:"bytes,10,opt,name=literal,proto3,oneof"` 160 } 161 162 func (*Spec_Object) isSpec_Block() {} 163 164 func (*Spec_Array) isSpec_Block() {} 165 166 func (*Spec_Attr) isSpec_Block() {} 167 168 func (*Spec_BlockValue) isSpec_Block() {} 169 170 func (*Spec_BlockAttrs) isSpec_Block() {} 171 172 func (*Spec_BlockList) isSpec_Block() {} 173 174 func (*Spec_BlockSet) isSpec_Block() {} 175 176 func (*Spec_BlockMap) isSpec_Block() {} 177 178 func (*Spec_Default) isSpec_Block() {} 179 180 func (*Spec_Literal) isSpec_Block() {} 181 182 func (m *Spec) GetBlock() isSpec_Block { 183 if m != nil { 184 return m.Block 185 } 186 return nil 187 } 188 189 func (m *Spec) GetObject() *Object { 190 if x, ok := m.GetBlock().(*Spec_Object); ok { 191 return x.Object 192 } 193 return nil 194 } 195 196 func (m *Spec) GetArray() *Array { 197 if x, ok := m.GetBlock().(*Spec_Array); ok { 198 return x.Array 199 } 200 return nil 201 } 202 203 func (m *Spec) GetAttr() *Attr { 204 if x, ok := m.GetBlock().(*Spec_Attr); ok { 205 return x.Attr 206 } 207 return nil 208 } 209 210 func (m *Spec) GetBlockValue() *Block { 211 if x, ok := m.GetBlock().(*Spec_BlockValue); ok { 212 return x.BlockValue 213 } 214 return nil 215 } 216 217 func (m *Spec) GetBlockAttrs() *BlockAttrs { 218 if x, ok := m.GetBlock().(*Spec_BlockAttrs); ok { 219 return x.BlockAttrs 220 } 221 return nil 222 } 223 224 func (m *Spec) GetBlockList() *BlockList { 225 if x, ok := m.GetBlock().(*Spec_BlockList); ok { 226 return x.BlockList 227 } 228 return nil 229 } 230 231 func (m *Spec) GetBlockSet() *BlockSet { 232 if x, ok := m.GetBlock().(*Spec_BlockSet); ok { 233 return x.BlockSet 234 } 235 return nil 236 } 237 238 func (m *Spec) GetBlockMap() *BlockMap { 239 if x, ok := m.GetBlock().(*Spec_BlockMap); ok { 240 return x.BlockMap 241 } 242 return nil 243 } 244 245 func (m *Spec) GetDefault() *Default { 246 if x, ok := m.GetBlock().(*Spec_Default); ok { 247 return x.Default 248 } 249 return nil 250 } 251 252 func (m *Spec) GetLiteral() *Literal { 253 if x, ok := m.GetBlock().(*Spec_Literal); ok { 254 return x.Literal 255 } 256 return nil 257 } 258 259 // XXX_OneofWrappers is for the internal use of the proto package. 260 func (*Spec) XXX_OneofWrappers() []interface{} { 261 return []interface{}{ 262 (*Spec_Object)(nil), 263 (*Spec_Array)(nil), 264 (*Spec_Attr)(nil), 265 (*Spec_BlockValue)(nil), 266 (*Spec_BlockAttrs)(nil), 267 (*Spec_BlockList)(nil), 268 (*Spec_BlockSet)(nil), 269 (*Spec_BlockMap)(nil), 270 (*Spec_Default)(nil), 271 (*Spec_Literal)(nil), 272 } 273 } 274 275 // Attr spec type reads the value of an attribute in the current body 276 //and returns that value as its result. It also creates validation constraints 277 //for the given attribute name and its value. 278 // 279 //```hcl 280 //Attr { 281 //name = "document_root" 282 //type = string 283 //required = true 284 //} 285 //``` 286 // 287 //`Attr` spec blocks accept the following arguments: 288 // 289 // `name` (required) - The attribute name to expect within the HCL input file. 290 //This may be omitted when a default name selector is created by a parent 291 //`Object` spec, if the input attribute name should match the output JSON 292 //object property name. 293 // 294 // `type` (optional) - A [type expression](#type-expressions) that the given 295 //attribute value must conform to. If this argument is set, `hcldec` will 296 //automatically convert the given input value to this type or produce an 297 //error if that is not possible. 298 // 299 // `required` (optional) - If set to `true`, `hcldec` will produce an error 300 //if a value is not provided for the source attribute. 301 // 302 //`Attr` is a leaf spec type, so no nested spec blocks are permitted. 303 type Attr struct { 304 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 305 Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` 306 Required bool `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"` 307 XXX_NoUnkeyedLiteral struct{} `json:"-"` 308 XXX_unrecognized []byte `json:"-"` 309 XXX_sizecache int32 `json:"-"` 310 } 311 312 func (m *Attr) Reset() { *m = Attr{} } 313 func (m *Attr) String() string { return proto.CompactTextString(m) } 314 func (*Attr) ProtoMessage() {} 315 func (*Attr) Descriptor() ([]byte, []int) { 316 return fileDescriptor_28863966909039be, []int{1} 317 } 318 319 func (m *Attr) XXX_Unmarshal(b []byte) error { 320 return xxx_messageInfo_Attr.Unmarshal(m, b) 321 } 322 func (m *Attr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 323 return xxx_messageInfo_Attr.Marshal(b, m, deterministic) 324 } 325 func (m *Attr) XXX_Merge(src proto.Message) { 326 xxx_messageInfo_Attr.Merge(m, src) 327 } 328 func (m *Attr) XXX_Size() int { 329 return xxx_messageInfo_Attr.Size(m) 330 } 331 func (m *Attr) XXX_DiscardUnknown() { 332 xxx_messageInfo_Attr.DiscardUnknown(m) 333 } 334 335 var xxx_messageInfo_Attr proto.InternalMessageInfo 336 337 func (m *Attr) GetName() string { 338 if m != nil { 339 return m.Name 340 } 341 return "" 342 } 343 344 func (m *Attr) GetType() string { 345 if m != nil { 346 return m.Type 347 } 348 return "" 349 } 350 351 func (m *Attr) GetRequired() bool { 352 if m != nil { 353 return m.Required 354 } 355 return false 356 } 357 358 // Block spec type applies one nested spec block to the contents of a 359 //block within the current body and returns the result of that spec. It also 360 //creates validation constraints for the given block type name. 361 // 362 //```hcl 363 //Block { 364 //name = "logging" 365 // 366 //Object { 367 //Attr "level" { 368 //type = string 369 //} 370 //Attr "file" { 371 //type = string 372 //} 373 //} 374 //} 375 //``` 376 // 377 //`Block` spec blocks accept the following arguments: 378 // 379 // `name` (required) - The block type name to expect within the HCL 380 //input file. This may be omitted when a default name selector is created 381 //by a parent `Object` spec, if the input block type name should match the 382 //output JSON object property name. 383 // 384 // `required` (optional) - If set to `true`, `hcldec` will produce an error 385 //if a block of the specified type is not present in the current body. 386 // 387 //`Block` creates a validation constraint that there must be zero or one blocks 388 //of the given type name, or exactly one if `required` is set. 389 // 390 //`Block` expects a single nested spec block, which is applied to the body of 391 //the block of the given type when it is present. 392 // 393 type Block struct { 394 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 395 Required bool `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"` 396 Nested *Spec `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"` 397 XXX_NoUnkeyedLiteral struct{} `json:"-"` 398 XXX_unrecognized []byte `json:"-"` 399 XXX_sizecache int32 `json:"-"` 400 } 401 402 func (m *Block) Reset() { *m = Block{} } 403 func (m *Block) String() string { return proto.CompactTextString(m) } 404 func (*Block) ProtoMessage() {} 405 func (*Block) Descriptor() ([]byte, []int) { 406 return fileDescriptor_28863966909039be, []int{2} 407 } 408 409 func (m *Block) XXX_Unmarshal(b []byte) error { 410 return xxx_messageInfo_Block.Unmarshal(m, b) 411 } 412 func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 413 return xxx_messageInfo_Block.Marshal(b, m, deterministic) 414 } 415 func (m *Block) XXX_Merge(src proto.Message) { 416 xxx_messageInfo_Block.Merge(m, src) 417 } 418 func (m *Block) XXX_Size() int { 419 return xxx_messageInfo_Block.Size(m) 420 } 421 func (m *Block) XXX_DiscardUnknown() { 422 xxx_messageInfo_Block.DiscardUnknown(m) 423 } 424 425 var xxx_messageInfo_Block proto.InternalMessageInfo 426 427 func (m *Block) GetName() string { 428 if m != nil { 429 return m.Name 430 } 431 return "" 432 } 433 434 func (m *Block) GetRequired() bool { 435 if m != nil { 436 return m.Required 437 } 438 return false 439 } 440 441 func (m *Block) GetNested() *Spec { 442 if m != nil { 443 return m.Nested 444 } 445 return nil 446 } 447 448 // 449 //The BlockAttrs spec type is similar to an Attr spec block of a map type, 450 //but it produces a map from the attributes of a block rather than from an 451 //attribute's expression. 452 // 453 //```hcl 454 //BlockAttrs { 455 //name = "variables" 456 //type = string 457 //required = false 458 //} 459 //``` 460 // 461 //This allows a map with user-defined keys to be produced within block syntax, 462 //but due to the constraints of that syntax it also means that the user will 463 //be unable to dynamically-generate either individual key names using key 464 //expressions or the entire map value using a `for` expression. 465 // 466 //`BlockAttrs` spec blocks accept the following arguments: 467 // 468 // `name` (required) - The block type name to expect within the HCL 469 //input file. This may be omitted when a default name selector is created 470 //by a parent `object` spec, if the input block type name should match the 471 //output JSON object property name. 472 // 473 // `type` (required) - The value type to require for each of the 474 //attributes within a matched block. The resulting value will be a JSON 475 //object whose property values are of this type. 476 // 477 // `required` (optional) - If `true`, an error will be produced if a block 478 //of the given type is not present. If `false` -- the default -- an absent 479 //block will be indicated by producing `null`. 480 type BlockAttrs struct { 481 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 482 Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` 483 Required bool `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"` 484 XXX_NoUnkeyedLiteral struct{} `json:"-"` 485 XXX_unrecognized []byte `json:"-"` 486 XXX_sizecache int32 `json:"-"` 487 } 488 489 func (m *BlockAttrs) Reset() { *m = BlockAttrs{} } 490 func (m *BlockAttrs) String() string { return proto.CompactTextString(m) } 491 func (*BlockAttrs) ProtoMessage() {} 492 func (*BlockAttrs) Descriptor() ([]byte, []int) { 493 return fileDescriptor_28863966909039be, []int{3} 494 } 495 496 func (m *BlockAttrs) XXX_Unmarshal(b []byte) error { 497 return xxx_messageInfo_BlockAttrs.Unmarshal(m, b) 498 } 499 func (m *BlockAttrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 500 return xxx_messageInfo_BlockAttrs.Marshal(b, m, deterministic) 501 } 502 func (m *BlockAttrs) XXX_Merge(src proto.Message) { 503 xxx_messageInfo_BlockAttrs.Merge(m, src) 504 } 505 func (m *BlockAttrs) XXX_Size() int { 506 return xxx_messageInfo_BlockAttrs.Size(m) 507 } 508 func (m *BlockAttrs) XXX_DiscardUnknown() { 509 xxx_messageInfo_BlockAttrs.DiscardUnknown(m) 510 } 511 512 var xxx_messageInfo_BlockAttrs proto.InternalMessageInfo 513 514 func (m *BlockAttrs) GetName() string { 515 if m != nil { 516 return m.Name 517 } 518 return "" 519 } 520 521 func (m *BlockAttrs) GetType() string { 522 if m != nil { 523 return m.Type 524 } 525 return "" 526 } 527 528 func (m *BlockAttrs) GetRequired() bool { 529 if m != nil { 530 return m.Required 531 } 532 return false 533 } 534 535 // BlockList spec type is similar to `Block`, but it accepts zero or 536 //more blocks of a specified type rather than requiring zero or one. The 537 //result is a JSON array with one entry per block of the given type. 538 // 539 //```hcl 540 //BlockList { 541 //name = "log_file" 542 // 543 //Object { 544 //Attr "level" { 545 //type = string 546 //} 547 //Attr "filename" { 548 //type = string 549 //required = true 550 //} 551 //} 552 //} 553 //``` 554 // 555 //`BlockList` spec blocks accept the following arguments: 556 // 557 // `name` (required) - The block type name to expect within the HCL 558 //input file. This may be omitted when a default name selector is created 559 //by a parent `Object` spec, if the input block type name should match the 560 //output JSON object property name. 561 // 562 // `min_items` (optional) - If set to a number greater than zero, `hcldec` will 563 //produce an error if fewer than the given number of blocks are present. 564 // 565 // `max_items` (optional) - If set to a number greater than zero, `hcldec` will 566 //produce an error if more than the given number of blocks are present. This 567 //attribute must be greater than or equal to `min_items` if both are set. 568 // 569 //`Block` creates a validation constraint on the number of blocks of the given 570 //type that must be present. 571 // 572 //`Block` expects a single nested spec block, which is applied to the body of 573 //each matching block to produce the resulting list items. 574 // 575 type BlockList struct { 576 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 577 MinItems uint64 `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` 578 MaxItems uint64 `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` 579 Nested *Spec `protobuf:"bytes,4,opt,name=nested,proto3" json:"nested,omitempty"` 580 XXX_NoUnkeyedLiteral struct{} `json:"-"` 581 XXX_unrecognized []byte `json:"-"` 582 XXX_sizecache int32 `json:"-"` 583 } 584 585 func (m *BlockList) Reset() { *m = BlockList{} } 586 func (m *BlockList) String() string { return proto.CompactTextString(m) } 587 func (*BlockList) ProtoMessage() {} 588 func (*BlockList) Descriptor() ([]byte, []int) { 589 return fileDescriptor_28863966909039be, []int{4} 590 } 591 592 func (m *BlockList) XXX_Unmarshal(b []byte) error { 593 return xxx_messageInfo_BlockList.Unmarshal(m, b) 594 } 595 func (m *BlockList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 596 return xxx_messageInfo_BlockList.Marshal(b, m, deterministic) 597 } 598 func (m *BlockList) XXX_Merge(src proto.Message) { 599 xxx_messageInfo_BlockList.Merge(m, src) 600 } 601 func (m *BlockList) XXX_Size() int { 602 return xxx_messageInfo_BlockList.Size(m) 603 } 604 func (m *BlockList) XXX_DiscardUnknown() { 605 xxx_messageInfo_BlockList.DiscardUnknown(m) 606 } 607 608 var xxx_messageInfo_BlockList proto.InternalMessageInfo 609 610 func (m *BlockList) GetName() string { 611 if m != nil { 612 return m.Name 613 } 614 return "" 615 } 616 617 func (m *BlockList) GetMinItems() uint64 { 618 if m != nil { 619 return m.MinItems 620 } 621 return 0 622 } 623 624 func (m *BlockList) GetMaxItems() uint64 { 625 if m != nil { 626 return m.MaxItems 627 } 628 return 0 629 } 630 631 func (m *BlockList) GetNested() *Spec { 632 if m != nil { 633 return m.Nested 634 } 635 return nil 636 } 637 638 // BlockSet spec type behaves the same as BlockList except that 639 //the result is in no specific order and any duplicate items are removed. 640 // 641 //```hcl 642 //BlockSet { 643 //name = "log_file" 644 // 645 //Object { 646 //Attr "level" { 647 //type = string 648 //} 649 //Attr "filename" { 650 //type = string 651 //required = true 652 //} 653 //} 654 //} 655 //``` 656 // 657 //The contents of `BlockSet` are the same as for `BlockList`. 658 // 659 type BlockSet struct { 660 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 661 MinItems uint64 `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` 662 MaxItems uint64 `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` 663 Nested *Spec `protobuf:"bytes,4,opt,name=nested,proto3" json:"nested,omitempty"` 664 XXX_NoUnkeyedLiteral struct{} `json:"-"` 665 XXX_unrecognized []byte `json:"-"` 666 XXX_sizecache int32 `json:"-"` 667 } 668 669 func (m *BlockSet) Reset() { *m = BlockSet{} } 670 func (m *BlockSet) String() string { return proto.CompactTextString(m) } 671 func (*BlockSet) ProtoMessage() {} 672 func (*BlockSet) Descriptor() ([]byte, []int) { 673 return fileDescriptor_28863966909039be, []int{5} 674 } 675 676 func (m *BlockSet) XXX_Unmarshal(b []byte) error { 677 return xxx_messageInfo_BlockSet.Unmarshal(m, b) 678 } 679 func (m *BlockSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 680 return xxx_messageInfo_BlockSet.Marshal(b, m, deterministic) 681 } 682 func (m *BlockSet) XXX_Merge(src proto.Message) { 683 xxx_messageInfo_BlockSet.Merge(m, src) 684 } 685 func (m *BlockSet) XXX_Size() int { 686 return xxx_messageInfo_BlockSet.Size(m) 687 } 688 func (m *BlockSet) XXX_DiscardUnknown() { 689 xxx_messageInfo_BlockSet.DiscardUnknown(m) 690 } 691 692 var xxx_messageInfo_BlockSet proto.InternalMessageInfo 693 694 func (m *BlockSet) GetName() string { 695 if m != nil { 696 return m.Name 697 } 698 return "" 699 } 700 701 func (m *BlockSet) GetMinItems() uint64 { 702 if m != nil { 703 return m.MinItems 704 } 705 return 0 706 } 707 708 func (m *BlockSet) GetMaxItems() uint64 { 709 if m != nil { 710 return m.MaxItems 711 } 712 return 0 713 } 714 715 func (m *BlockSet) GetNested() *Spec { 716 if m != nil { 717 return m.Nested 718 } 719 return nil 720 } 721 722 // BlockMap spec type is similar to `Block`, but it accepts zero or 723 //more blocks of a specified type rather than requiring zero or one. The 724 //result is a JSON object, or possibly multiple nested JSON objects, whose 725 //properties are derived from the labels set on each matching block. 726 // 727 //```hcl 728 //BlockMap { 729 //name = "log_file" 730 //labels = ["filename"] 731 // 732 //Object { 733 //Attr "level" { 734 //type = string 735 //required = true 736 //} 737 //} 738 //} 739 //``` 740 // 741 //`BlockMap` spec blocks accept the following arguments: 742 // 743 // `name` (required) - The block type name to expect within the HCL 744 //input file. This may be omitted when a default name selector is created 745 //by a parent `Object` spec, if the input block type name should match the 746 //output JSON object property name. 747 // 748 // `labels` (required) - A list of user-oriented block label names. Each entry 749 //in this list creates one level of object within the output value, and 750 //requires one additional block header label on any child block of this type. 751 //Block header labels are the quoted strings that appear after the block type 752 //name but before the opening `{`. 753 // 754 //`Block` creates a validation constraint on the number of labels that blocks 755 //of the given type must have. 756 // 757 //`Block` expects a single nested spec block, which is applied to the body of 758 //each matching block to produce the resulting map items. 759 // 760 type BlockMap struct { 761 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 762 Labels []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"` 763 Nested *Spec `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"` 764 XXX_NoUnkeyedLiteral struct{} `json:"-"` 765 XXX_unrecognized []byte `json:"-"` 766 XXX_sizecache int32 `json:"-"` 767 } 768 769 func (m *BlockMap) Reset() { *m = BlockMap{} } 770 func (m *BlockMap) String() string { return proto.CompactTextString(m) } 771 func (*BlockMap) ProtoMessage() {} 772 func (*BlockMap) Descriptor() ([]byte, []int) { 773 return fileDescriptor_28863966909039be, []int{6} 774 } 775 776 func (m *BlockMap) XXX_Unmarshal(b []byte) error { 777 return xxx_messageInfo_BlockMap.Unmarshal(m, b) 778 } 779 func (m *BlockMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 780 return xxx_messageInfo_BlockMap.Marshal(b, m, deterministic) 781 } 782 func (m *BlockMap) XXX_Merge(src proto.Message) { 783 xxx_messageInfo_BlockMap.Merge(m, src) 784 } 785 func (m *BlockMap) XXX_Size() int { 786 return xxx_messageInfo_BlockMap.Size(m) 787 } 788 func (m *BlockMap) XXX_DiscardUnknown() { 789 xxx_messageInfo_BlockMap.DiscardUnknown(m) 790 } 791 792 var xxx_messageInfo_BlockMap proto.InternalMessageInfo 793 794 func (m *BlockMap) GetName() string { 795 if m != nil { 796 return m.Name 797 } 798 return "" 799 } 800 801 func (m *BlockMap) GetLabels() []string { 802 if m != nil { 803 return m.Labels 804 } 805 return nil 806 } 807 808 func (m *BlockMap) GetNested() *Spec { 809 if m != nil { 810 return m.Nested 811 } 812 return nil 813 } 814 815 // Literal spec type returns a given literal value, and creates no 816 //validation constraints. It is most commonly used with the `Default` spec 817 //type to create a fallback value, but can also be used e.g. to fill out 818 //required properties in an `Object` spec that do not correspond to any 819 //construct in the input configuration. 820 // 821 //```hcl 822 //Literal { 823 //value = "hello world" 824 //} 825 //``` 826 // 827 //`Literal` spec blocks accept the following argument: 828 // 829 // `value` (required) - The value to return. This attribute may be an expression 830 //that uses [functions](#spec-definition-functions). 831 // 832 //`Literal` is a leaf spec type, so no nested spec blocks are permitted. 833 type Literal struct { 834 Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` 835 XXX_NoUnkeyedLiteral struct{} `json:"-"` 836 XXX_unrecognized []byte `json:"-"` 837 XXX_sizecache int32 `json:"-"` 838 } 839 840 func (m *Literal) Reset() { *m = Literal{} } 841 func (m *Literal) String() string { return proto.CompactTextString(m) } 842 func (*Literal) ProtoMessage() {} 843 func (*Literal) Descriptor() ([]byte, []int) { 844 return fileDescriptor_28863966909039be, []int{7} 845 } 846 847 func (m *Literal) XXX_Unmarshal(b []byte) error { 848 return xxx_messageInfo_Literal.Unmarshal(m, b) 849 } 850 func (m *Literal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 851 return xxx_messageInfo_Literal.Marshal(b, m, deterministic) 852 } 853 func (m *Literal) XXX_Merge(src proto.Message) { 854 xxx_messageInfo_Literal.Merge(m, src) 855 } 856 func (m *Literal) XXX_Size() int { 857 return xxx_messageInfo_Literal.Size(m) 858 } 859 func (m *Literal) XXX_DiscardUnknown() { 860 xxx_messageInfo_Literal.DiscardUnknown(m) 861 } 862 863 var xxx_messageInfo_Literal proto.InternalMessageInfo 864 865 func (m *Literal) GetValue() string { 866 if m != nil { 867 return m.Value 868 } 869 return "" 870 } 871 872 // Default spec type evaluates a sequence of nested specs in turn and 873 //returns the result of the first one that produces a non-null value. 874 //It creates no validation constraints of its own, but passes on the validation 875 //constraints from its first nested block. 876 // 877 //```hcl 878 //Default { 879 //Attr { 880 //name = "private" 881 //type = bool 882 //} 883 //Literal { 884 //value = false 885 //} 886 //} 887 //``` 888 // 889 //A `Default` spec block must have at least one nested spec block, and should 890 //generally have at least two since otherwise the `Default` wrapper is a no-op. 891 // 892 //The second and any subsequent spec blocks are _fallback_ specs. These exhibit 893 //their usual behavior but are not able to impose validation constraints on the 894 //current body since they are not evaluated unless all prior specs produce 895 //`null` as their result. 896 // 897 type Default struct { 898 Primary *Spec `protobuf:"bytes,1,opt,name=primary,proto3" json:"primary,omitempty"` 899 Default *Spec `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"` 900 XXX_NoUnkeyedLiteral struct{} `json:"-"` 901 XXX_unrecognized []byte `json:"-"` 902 XXX_sizecache int32 `json:"-"` 903 } 904 905 func (m *Default) Reset() { *m = Default{} } 906 func (m *Default) String() string { return proto.CompactTextString(m) } 907 func (*Default) ProtoMessage() {} 908 func (*Default) Descriptor() ([]byte, []int) { 909 return fileDescriptor_28863966909039be, []int{8} 910 } 911 912 func (m *Default) XXX_Unmarshal(b []byte) error { 913 return xxx_messageInfo_Default.Unmarshal(m, b) 914 } 915 func (m *Default) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 916 return xxx_messageInfo_Default.Marshal(b, m, deterministic) 917 } 918 func (m *Default) XXX_Merge(src proto.Message) { 919 xxx_messageInfo_Default.Merge(m, src) 920 } 921 func (m *Default) XXX_Size() int { 922 return xxx_messageInfo_Default.Size(m) 923 } 924 func (m *Default) XXX_DiscardUnknown() { 925 xxx_messageInfo_Default.DiscardUnknown(m) 926 } 927 928 var xxx_messageInfo_Default proto.InternalMessageInfo 929 930 func (m *Default) GetPrimary() *Spec { 931 if m != nil { 932 return m.Primary 933 } 934 return nil 935 } 936 937 func (m *Default) GetDefault() *Spec { 938 if m != nil { 939 return m.Default 940 } 941 return nil 942 } 943 944 // Object spec type is the most commonly used at the root of a spec file. 945 //Its result is a JSON object whose properties are set based on any nested 946 //spec blocks: 947 // 948 //```hcl 949 //Object { 950 //Attr "name" { 951 //type = "string" 952 //} 953 //Block "address" { 954 //Object { 955 //Attr "street" { 956 //type = "string" 957 //} 958 //# ... 959 //} 960 //} 961 //} 962 //``` 963 // 964 //Nested spec blocks inside `Object` must always have an extra block label 965 //`"name"`, `"address"` and `"street"` in the above example) that specifies 966 //the name of the property that should be created in the JSON object result. 967 //This label also acts as a default name selector for the nested spec, allowing 968 //the `Attr` blocks in the above example to omit the usually-required `name` 969 //argument in cases where the HCL input name and JSON output name are the same. 970 // 971 //An `Object` spec block creates no validation constraints, but it passes on 972 //any validation constraints created by the nested specs. 973 type Object struct { 974 Attributes map[string]*Spec `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 975 XXX_NoUnkeyedLiteral struct{} `json:"-"` 976 XXX_unrecognized []byte `json:"-"` 977 XXX_sizecache int32 `json:"-"` 978 } 979 980 func (m *Object) Reset() { *m = Object{} } 981 func (m *Object) String() string { return proto.CompactTextString(m) } 982 func (*Object) ProtoMessage() {} 983 func (*Object) Descriptor() ([]byte, []int) { 984 return fileDescriptor_28863966909039be, []int{9} 985 } 986 987 func (m *Object) XXX_Unmarshal(b []byte) error { 988 return xxx_messageInfo_Object.Unmarshal(m, b) 989 } 990 func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 991 return xxx_messageInfo_Object.Marshal(b, m, deterministic) 992 } 993 func (m *Object) XXX_Merge(src proto.Message) { 994 xxx_messageInfo_Object.Merge(m, src) 995 } 996 func (m *Object) XXX_Size() int { 997 return xxx_messageInfo_Object.Size(m) 998 } 999 func (m *Object) XXX_DiscardUnknown() { 1000 xxx_messageInfo_Object.DiscardUnknown(m) 1001 } 1002 1003 var xxx_messageInfo_Object proto.InternalMessageInfo 1004 1005 func (m *Object) GetAttributes() map[string]*Spec { 1006 if m != nil { 1007 return m.Attributes 1008 } 1009 return nil 1010 } 1011 1012 // Array spec type produces a JSON array whose elements are set based on 1013 //any nested spec blocks: 1014 // 1015 //```hcl 1016 //Array { 1017 //Attr { 1018 //name = "first_element" 1019 //type = "string" 1020 //} 1021 //Attr { 1022 //name = "second_element" 1023 //type = "string" 1024 //} 1025 //} 1026 //``` 1027 // 1028 //An `Array` spec block creates no validation constraints, but it passes on 1029 //any validation constraints created by the nested specs. 1030 type Array struct { 1031 Values []*Spec `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` 1032 XXX_NoUnkeyedLiteral struct{} `json:"-"` 1033 XXX_unrecognized []byte `json:"-"` 1034 XXX_sizecache int32 `json:"-"` 1035 } 1036 1037 func (m *Array) Reset() { *m = Array{} } 1038 func (m *Array) String() string { return proto.CompactTextString(m) } 1039 func (*Array) ProtoMessage() {} 1040 func (*Array) Descriptor() ([]byte, []int) { 1041 return fileDescriptor_28863966909039be, []int{10} 1042 } 1043 1044 func (m *Array) XXX_Unmarshal(b []byte) error { 1045 return xxx_messageInfo_Array.Unmarshal(m, b) 1046 } 1047 func (m *Array) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 1048 return xxx_messageInfo_Array.Marshal(b, m, deterministic) 1049 } 1050 func (m *Array) XXX_Merge(src proto.Message) { 1051 xxx_messageInfo_Array.Merge(m, src) 1052 } 1053 func (m *Array) XXX_Size() int { 1054 return xxx_messageInfo_Array.Size(m) 1055 } 1056 func (m *Array) XXX_DiscardUnknown() { 1057 xxx_messageInfo_Array.DiscardUnknown(m) 1058 } 1059 1060 var xxx_messageInfo_Array proto.InternalMessageInfo 1061 1062 func (m *Array) GetValues() []*Spec { 1063 if m != nil { 1064 return m.Values 1065 } 1066 return nil 1067 } 1068 1069 func init() { 1070 proto.RegisterType((*Spec)(nil), "hashicorp.nomad.plugins.shared.hclspec.Spec") 1071 proto.RegisterType((*Attr)(nil), "hashicorp.nomad.plugins.shared.hclspec.Attr") 1072 proto.RegisterType((*Block)(nil), "hashicorp.nomad.plugins.shared.hclspec.Block") 1073 proto.RegisterType((*BlockAttrs)(nil), "hashicorp.nomad.plugins.shared.hclspec.BlockAttrs") 1074 proto.RegisterType((*BlockList)(nil), "hashicorp.nomad.plugins.shared.hclspec.BlockList") 1075 proto.RegisterType((*BlockSet)(nil), "hashicorp.nomad.plugins.shared.hclspec.BlockSet") 1076 proto.RegisterType((*BlockMap)(nil), "hashicorp.nomad.plugins.shared.hclspec.BlockMap") 1077 proto.RegisterType((*Literal)(nil), "hashicorp.nomad.plugins.shared.hclspec.Literal") 1078 proto.RegisterType((*Default)(nil), "hashicorp.nomad.plugins.shared.hclspec.Default") 1079 proto.RegisterType((*Object)(nil), "hashicorp.nomad.plugins.shared.hclspec.Object") 1080 proto.RegisterMapType((map[string]*Spec)(nil), "hashicorp.nomad.plugins.shared.hclspec.Object.AttributesEntry") 1081 proto.RegisterType((*Array)(nil), "hashicorp.nomad.plugins.shared.hclspec.Array") 1082 } 1083 1084 func init() { 1085 proto.RegisterFile("plugins/shared/hclspec/hcl_spec.proto", fileDescriptor_28863966909039be) 1086 } 1087 1088 var fileDescriptor_28863966909039be = []byte{ 1089 // 624 bytes of a gzipped FileDescriptorProto 1090 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x4d, 0x6f, 0xd3, 0x4c, 1091 0x10, 0xc7, 0xe3, 0xc4, 0xaf, 0xd3, 0xc3, 0xf3, 0x68, 0x85, 0x90, 0x55, 0x0e, 0x54, 0x96, 0x40, 1092 0x3d, 0x80, 0x0b, 0xe5, 0x82, 0x38, 0x20, 0x35, 0x6a, 0x91, 0x81, 0x46, 0xad, 0xb6, 0x82, 0x03, 1093 0x07, 0xa2, 0xb5, 0xb3, 0x10, 0x13, 0xbf, 0xb1, 0xbb, 0x41, 0x8d, 0x04, 0x1f, 0x84, 0x03, 0xf0, 1094 0xa9, 0xf8, 0x3e, 0x68, 0x5f, 0x9c, 0x14, 0x94, 0x43, 0x1c, 0x7a, 0xe0, 0x94, 0x19, 0x8f, 0xfe, 1095 0x3f, 0xcf, 0xec, 0xce, 0x78, 0x02, 0x77, 0x9a, 0x62, 0xfe, 0x3e, 0xaf, 0xf8, 0x01, 0x9f, 0x12, 1096 0x46, 0x27, 0x07, 0xd3, 0xac, 0xe0, 0x0d, 0xcd, 0xe4, 0xef, 0x58, 0x1a, 0x71, 0xc3, 0x6a, 0x51, 1097 0xa3, 0xbb, 0x53, 0xc2, 0xa7, 0x79, 0x56, 0xb3, 0x26, 0xae, 0xea, 0x92, 0x4c, 0x62, 0x23, 0x8b, 1098 0xb5, 0x2c, 0x36, 0xb2, 0xe8, 0x9b, 0x0b, 0xf6, 0x45, 0x43, 0x33, 0x94, 0x80, 0x5b, 0xa7, 0x1f, 1099 0x68, 0x26, 0x42, 0x6b, 0xcf, 0xda, 0xdf, 0x39, 0x8c, 0xe3, 0xcd, 0x08, 0xf1, 0x99, 0x52, 0x25, 1100 0x3d, 0x6c, 0xf4, 0xe8, 0x04, 0x1c, 0xc2, 0x18, 0x59, 0x84, 0x7d, 0x05, 0xba, 0xbf, 0x29, 0xe8, 1101 0x48, 0x8a, 0x92, 0x1e, 0xd6, 0x6a, 0x34, 0x04, 0xfb, 0x48, 0x08, 0x16, 0x0e, 0x14, 0xe5, 0xde, 1102 0xc6, 0x14, 0x21, 0x58, 0xd2, 0xc3, 0x4a, 0x8b, 0xce, 0x61, 0x27, 0x2d, 0xea, 0x6c, 0x36, 0xfe, 1103 0x44, 0x8a, 0x39, 0x0d, 0xed, 0x6e, 0x09, 0x0d, 0xa5, 0x34, 0xe9, 0x61, 0x50, 0x8c, 0xd7, 0x12, 1104 0x81, 0x5e, 0xb5, 0x44, 0x22, 0x04, 0xe3, 0xa1, 0xa3, 0x88, 0x87, 0x9d, 0x88, 0x32, 0x33, 0xbe, 1105 0xc4, 0x2a, 0x0f, 0x61, 0xd0, 0xde, 0xb8, 0xc8, 0xb9, 0x08, 0x5d, 0x45, 0x7d, 0xd8, 0x89, 0x7a, 1106 0x9a, 0x73, 0x79, 0x09, 0x41, 0xda, 0x3a, 0xe8, 0x0c, 0xb4, 0x33, 0xe6, 0x54, 0x84, 0x9e, 0x42, 1107 0x3e, 0xe8, 0x84, 0xbc, 0xa0, 0x92, 0xe8, 0xa7, 0xc6, 0x5e, 0x01, 0x4b, 0xd2, 0x84, 0xfe, 0x16, 1108 0xc0, 0x11, 0x69, 0x96, 0xc0, 0x11, 0x69, 0xd0, 0x4b, 0xf0, 0x26, 0xf4, 0x1d, 0x99, 0x17, 0x22, 1109 0x0c, 0x14, 0xee, 0x60, 0x53, 0xdc, 0xb1, 0x96, 0x25, 0x3d, 0xdc, 0x12, 0x24, 0xac, 0xc8, 0x05, 1110 0x65, 0xa4, 0x08, 0xa1, 0x1b, 0xec, 0x54, 0xcb, 0x24, 0xcc, 0x10, 0x86, 0x1e, 0x38, 0x2a, 0xcb, 1111 0xe8, 0x85, 0xee, 0x42, 0x84, 0xc0, 0xae, 0x48, 0x49, 0xd5, 0x70, 0x04, 0x58, 0xd9, 0xf2, 0x99, 1112 0x58, 0x34, 0x54, 0xf5, 0x79, 0x80, 0x95, 0x8d, 0x76, 0xc1, 0x67, 0xf4, 0xe3, 0x3c, 0x67, 0x74, 1113 0xa2, 0x3a, 0xd7, 0xc7, 0x4b, 0x3f, 0xfa, 0x02, 0x8e, 0x3a, 0x86, 0xb5, 0xb0, 0xab, 0xc2, 0xfe, 1114 0xef, 0x42, 0x74, 0x0c, 0x6e, 0x45, 0xb9, 0x30, 0xc8, 0x0e, 0xc3, 0x20, 0x27, 0x1b, 0x1b, 0x6d, 1115 0x74, 0x0e, 0xb0, 0xea, 0xbf, 0x6b, 0x29, 0xe8, 0x87, 0x05, 0xc1, 0xb2, 0xf9, 0xd6, 0x12, 0x6f, 1116 0x41, 0x50, 0xe6, 0xd5, 0x38, 0x17, 0xb4, 0xe4, 0x0a, 0x6b, 0x63, 0xbf, 0xcc, 0xab, 0xe7, 0xd2, 1117 0x57, 0x41, 0x72, 0x69, 0x82, 0x03, 0x13, 0x24, 0x97, 0x3a, 0xb8, 0xaa, 0xd9, 0xfe, 0x8b, 0x9a, 1118 0xbf, 0x5b, 0xe0, 0xb7, 0xbd, 0xfc, 0x4f, 0x26, 0xf8, 0xd9, 0xe4, 0x27, 0xc7, 0x61, 0x5d, 0x7e, 1119 0x37, 0xc1, 0x2d, 0x48, 0x4a, 0x0b, 0x99, 0xdc, 0x60, 0x3f, 0xc0, 0xc6, 0xbb, 0xa6, 0x96, 0xb8, 1120 0x0d, 0x9e, 0x69, 0x7e, 0x74, 0x03, 0x1c, 0xfd, 0x91, 0xd4, 0x6f, 0xd7, 0x4e, 0xf4, 0xd5, 0x02, 1121 0xcf, 0xcc, 0x1a, 0x7a, 0x06, 0x5e, 0xc3, 0xf2, 0x92, 0xb0, 0x85, 0x59, 0x11, 0xdd, 0xde, 0xd9, 1122 0x8a, 0x25, 0xa7, 0x9d, 0xfa, 0xfe, 0x36, 0x1c, 0x23, 0x8e, 0x7e, 0x5a, 0xe0, 0xea, 0xe5, 0x83, 1123 0xde, 0x02, 0xc8, 0xef, 0x71, 0x9e, 0xce, 0x05, 0xe5, 0xa1, 0xb5, 0x37, 0xd8, 0xdf, 0x39, 0x7c, 1124 0xda, 0x6d, 0x81, 0xa9, 0xc5, 0xa1, 0x01, 0x27, 0x95, 0x60, 0x0b, 0x7c, 0x85, 0xb8, 0x3b, 0x83, 1125 0xff, 0xfe, 0x08, 0xa3, 0xff, 0x61, 0x30, 0xa3, 0x0b, 0x73, 0x5a, 0xd2, 0x44, 0xc3, 0xf6, 0x04, 1126 0xb7, 0xa9, 0x4a, 0x4b, 0x9f, 0xf4, 0x1f, 0x5b, 0xd1, 0x08, 0x1c, 0xb5, 0x0a, 0xe5, 0x1d, 0xab, 1127 0xa7, 0x6d, 0x45, 0x1d, 0xef, 0x58, 0x6b, 0x87, 0xc1, 0x1b, 0xcf, 0x3c, 0x4f, 0x5d, 0xf5, 0xdf, 1128 0xe0, 0xd1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x20, 0x9f, 0xf2, 0x44, 0x08, 0x00, 0x00, 1129 }