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