nomad: github.com/hashicorp/nomad/plugins/shared/hclspec Index | Files

package hclspec

import "github.com/hashicorp/nomad/plugins/shared/hclspec"

Index

Package Files

hcl_spec.pb.go spec.go

type Array Uses

type Array struct {
    Values               []*Spec  `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Array spec type produces a JSON array whose elements are set based on any nested spec blocks:

“`hcl Array { Attr { name = "first_element" type = "string" } Attr { name = "second_element" type = "string" } } “`

An `Array` spec block creates no validation constraints, but it passes on any validation constraints created by the nested specs.

func (*Array) Descriptor Uses

func (*Array) Descriptor() ([]byte, []int)

func (*Array) GetValues Uses

func (m *Array) GetValues() []*Spec

func (*Array) ProtoMessage Uses

func (*Array) ProtoMessage()

func (*Array) Reset Uses

func (m *Array) Reset()

func (*Array) String Uses

func (m *Array) String() string

func (*Array) XXX_DiscardUnknown Uses

func (m *Array) XXX_DiscardUnknown()

func (*Array) XXX_Marshal Uses

func (m *Array) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Array) XXX_Merge Uses

func (m *Array) XXX_Merge(src proto.Message)

func (*Array) XXX_Size Uses

func (m *Array) XXX_Size() int

func (*Array) XXX_Unmarshal Uses

func (m *Array) XXX_Unmarshal(b []byte) error

type Attr Uses

type Attr struct {
    Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    Type                 string   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
    Required             bool     `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Attr spec type reads the value of an attribute in the current body and returns that value as its result. It also creates validation constraints for the given attribute name and its value.

“`hcl Attr { name = "document_root" type = string required = true } “`

`Attr` spec blocks accept the following arguments:

`name` (required) - The attribute name to expect within the HCL input file. This may be omitted when a default name selector is created by a parent `Object` spec, if the input attribute name should match the output JSON object property name.

`type` (optional) - A [type expression](#type-expressions) that the given attribute value must conform to. If this argument is set, `hcldec` will automatically convert the given input value to this type or produce an error if that is not possible.

`required` (optional) - If set to `true`, `hcldec` will produce an error if a value is not provided for the source attribute.

`Attr` is a leaf spec type, so no nested spec blocks are permitted.

func (*Attr) Descriptor Uses

func (*Attr) Descriptor() ([]byte, []int)

func (*Attr) GetName Uses

func (m *Attr) GetName() string

func (*Attr) GetRequired Uses

func (m *Attr) GetRequired() bool

func (*Attr) GetType Uses

func (m *Attr) GetType() string

func (*Attr) ProtoMessage Uses

func (*Attr) ProtoMessage()

func (*Attr) Reset Uses

func (m *Attr) Reset()

func (*Attr) String Uses

func (m *Attr) String() string

func (*Attr) XXX_DiscardUnknown Uses

func (m *Attr) XXX_DiscardUnknown()

func (*Attr) XXX_Marshal Uses

func (m *Attr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Attr) XXX_Merge Uses

func (m *Attr) XXX_Merge(src proto.Message)

func (*Attr) XXX_Size Uses

func (m *Attr) XXX_Size() int

func (*Attr) XXX_Unmarshal Uses

func (m *Attr) XXX_Unmarshal(b []byte) error

type Block Uses

type Block struct {
    Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    Required             bool     `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"`
    Nested               *Spec    `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Block spec type applies one nested spec block to the contents of a block within the current body and returns the result of that spec. It also creates validation constraints for the given block type name.

“`hcl Block { name = "logging"

Object { Attr "level" { type = string } Attr "file" { type = string } } } “`

`Block` spec blocks accept the following arguments:

`name` (required) - The block type name to expect within the HCL input file. This may be omitted when a default name selector is created by a parent `Object` spec, if the input block type name should match the output JSON object property name.

`required` (optional) - If set to `true`, `hcldec` will produce an error if a block of the specified type is not present in the current body.

`Block` creates a validation constraint that there must be zero or one blocks of the given type name, or exactly one if `required` is set.

`Block` expects a single nested spec block, which is applied to the body of the block of the given type when it is present.

func (*Block) Descriptor Uses

func (*Block) Descriptor() ([]byte, []int)

func (*Block) GetName Uses

func (m *Block) GetName() string

func (*Block) GetNested Uses

func (m *Block) GetNested() *Spec

func (*Block) GetRequired Uses

func (m *Block) GetRequired() bool

func (*Block) ProtoMessage Uses

func (*Block) ProtoMessage()

func (*Block) Reset Uses

func (m *Block) Reset()

func (*Block) String Uses

func (m *Block) String() string

func (*Block) XXX_DiscardUnknown Uses

func (m *Block) XXX_DiscardUnknown()

func (*Block) XXX_Marshal Uses

func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Block) XXX_Merge Uses

func (m *Block) XXX_Merge(src proto.Message)

func (*Block) XXX_Size Uses

func (m *Block) XXX_Size() int

func (*Block) XXX_Unmarshal Uses

func (m *Block) XXX_Unmarshal(b []byte) error

type BlockAttrs Uses

type BlockAttrs struct {
    Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    Type                 string   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
    Required             bool     `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

The BlockAttrs spec type is similar to an Attr spec block of a map type, but it produces a map from the attributes of a block rather than from an attribute's expression.

“`hcl BlockAttrs { name = "variables" type = string required = false } “`

This allows a map with user-defined keys to be produced within block syntax, but due to the constraints of that syntax it also means that the user will be unable to dynamically-generate either individual key names using key expressions or the entire map value using a `for` expression.

`BlockAttrs` spec blocks accept the following arguments:

`name` (required) - The block type name to expect within the HCL input file. This may be omitted when a default name selector is created by a parent `object` spec, if the input block type name should match the output JSON object property name.

`type` (required) - The value type to require for each of the attributes within a matched block. The resulting value will be a JSON object whose property values are of this type.

`required` (optional) - If `true`, an error will be produced if a block of the given type is not present. If `false` -- the default -- an absent block will be indicated by producing `null`.

func (*BlockAttrs) Descriptor Uses

func (*BlockAttrs) Descriptor() ([]byte, []int)

func (*BlockAttrs) GetName Uses

func (m *BlockAttrs) GetName() string

func (*BlockAttrs) GetRequired Uses

func (m *BlockAttrs) GetRequired() bool

func (*BlockAttrs) GetType Uses

func (m *BlockAttrs) GetType() string

func (*BlockAttrs) ProtoMessage Uses

func (*BlockAttrs) ProtoMessage()

func (*BlockAttrs) Reset Uses

func (m *BlockAttrs) Reset()

func (*BlockAttrs) String Uses

func (m *BlockAttrs) String() string

func (*BlockAttrs) XXX_DiscardUnknown Uses

func (m *BlockAttrs) XXX_DiscardUnknown()

func (*BlockAttrs) XXX_Marshal Uses

func (m *BlockAttrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockAttrs) XXX_Merge Uses

func (m *BlockAttrs) XXX_Merge(src proto.Message)

func (*BlockAttrs) XXX_Size Uses

func (m *BlockAttrs) XXX_Size() int

func (*BlockAttrs) XXX_Unmarshal Uses

func (m *BlockAttrs) XXX_Unmarshal(b []byte) error

type BlockList Uses

type BlockList struct {
    Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    MinItems             uint64   `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
    MaxItems             uint64   `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
    Nested               *Spec    `protobuf:"bytes,4,opt,name=nested,proto3" json:"nested,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

BlockList spec type is similar to `Block`, but it accepts zero or more blocks of a specified type rather than requiring zero or one. The result is a JSON array with one entry per block of the given type.

“`hcl BlockList { name = "log_file"

Object { Attr "level" { type = string } Attr "filename" { type = string required = true } } } “`

`BlockList` spec blocks accept the following arguments:

`name` (required) - The block type name to expect within the HCL input file. This may be omitted when a default name selector is created by a parent `Object` spec, if the input block type name should match the output JSON object property name.

`min_items` (optional) - If set to a number greater than zero, `hcldec` will produce an error if fewer than the given number of blocks are present.

`max_items` (optional) - If set to a number greater than zero, `hcldec` will produce an error if more than the given number of blocks are present. This attribute must be greater than or equal to `min_items` if both are set.

`Block` creates a validation constraint on the number of blocks of the given type that must be present.

`Block` expects a single nested spec block, which is applied to the body of each matching block to produce the resulting list items.

func (*BlockList) Descriptor Uses

func (*BlockList) Descriptor() ([]byte, []int)

func (*BlockList) GetMaxItems Uses

func (m *BlockList) GetMaxItems() uint64

func (*BlockList) GetMinItems Uses

func (m *BlockList) GetMinItems() uint64

func (*BlockList) GetName Uses

func (m *BlockList) GetName() string

func (*BlockList) GetNested Uses

func (m *BlockList) GetNested() *Spec

func (*BlockList) ProtoMessage Uses

func (*BlockList) ProtoMessage()

func (*BlockList) Reset Uses

func (m *BlockList) Reset()

func (*BlockList) String Uses

func (m *BlockList) String() string

func (*BlockList) XXX_DiscardUnknown Uses

func (m *BlockList) XXX_DiscardUnknown()

func (*BlockList) XXX_Marshal Uses

func (m *BlockList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockList) XXX_Merge Uses

func (m *BlockList) XXX_Merge(src proto.Message)

func (*BlockList) XXX_Size Uses

func (m *BlockList) XXX_Size() int

func (*BlockList) XXX_Unmarshal Uses

func (m *BlockList) XXX_Unmarshal(b []byte) error

type BlockMap Uses

type BlockMap struct {
    Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    Labels               []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
    Nested               *Spec    `protobuf:"bytes,3,opt,name=nested,proto3" json:"nested,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

BlockMap spec type is similar to `Block`, but it accepts zero or more blocks of a specified type rather than requiring zero or one. The result is a JSON object, or possibly multiple nested JSON objects, whose properties are derived from the labels set on each matching block.

“`hcl BlockMap { name = "log_file" labels = ["filename"]

Object { Attr "level" { type = string required = true } } } “`

`BlockMap` spec blocks accept the following arguments:

`name` (required) - The block type name to expect within the HCL input file. This may be omitted when a default name selector is created by a parent `Object` spec, if the input block type name should match the output JSON object property name.

`labels` (required) - A list of user-oriented block label names. Each entry in this list creates one level of object within the output value, and requires one additional block header label on any child block of this type. Block header labels are the quoted strings that appear after the block type name but before the opening `{`.

`Block` creates a validation constraint on the number of labels that blocks of the given type must have.

`Block` expects a single nested spec block, which is applied to the body of each matching block to produce the resulting map items.

func (*BlockMap) Descriptor Uses

func (*BlockMap) Descriptor() ([]byte, []int)

func (*BlockMap) GetLabels Uses

func (m *BlockMap) GetLabels() []string

func (*BlockMap) GetName Uses

func (m *BlockMap) GetName() string

func (*BlockMap) GetNested Uses

func (m *BlockMap) GetNested() *Spec

func (*BlockMap) ProtoMessage Uses

func (*BlockMap) ProtoMessage()

func (*BlockMap) Reset Uses

func (m *BlockMap) Reset()

func (*BlockMap) String Uses

func (m *BlockMap) String() string

func (*BlockMap) XXX_DiscardUnknown Uses

func (m *BlockMap) XXX_DiscardUnknown()

func (*BlockMap) XXX_Marshal Uses

func (m *BlockMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockMap) XXX_Merge Uses

func (m *BlockMap) XXX_Merge(src proto.Message)

func (*BlockMap) XXX_Size Uses

func (m *BlockMap) XXX_Size() int

func (*BlockMap) XXX_Unmarshal Uses

func (m *BlockMap) XXX_Unmarshal(b []byte) error

type BlockSet Uses

type BlockSet struct {
    Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    MinItems             uint64   `protobuf:"varint,2,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
    MaxItems             uint64   `protobuf:"varint,3,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
    Nested               *Spec    `protobuf:"bytes,4,opt,name=nested,proto3" json:"nested,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

BlockSet spec type behaves the same as BlockList except that the result is in no specific order and any duplicate items are removed.

“`hcl BlockSet { name = "log_file"

Object { Attr "level" { type = string } Attr "filename" { type = string required = true } } } “`

The contents of `BlockSet` are the same as for `BlockList`.

func (*BlockSet) Descriptor Uses

func (*BlockSet) Descriptor() ([]byte, []int)

func (*BlockSet) GetMaxItems Uses

func (m *BlockSet) GetMaxItems() uint64

func (*BlockSet) GetMinItems Uses

func (m *BlockSet) GetMinItems() uint64

func (*BlockSet) GetName Uses

func (m *BlockSet) GetName() string

func (*BlockSet) GetNested Uses

func (m *BlockSet) GetNested() *Spec

func (*BlockSet) ProtoMessage Uses

func (*BlockSet) ProtoMessage()

func (*BlockSet) Reset Uses

func (m *BlockSet) Reset()

func (*BlockSet) String Uses

func (m *BlockSet) String() string

func (*BlockSet) XXX_DiscardUnknown Uses

func (m *BlockSet) XXX_DiscardUnknown()

func (*BlockSet) XXX_Marshal Uses

func (m *BlockSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockSet) XXX_Merge Uses

func (m *BlockSet) XXX_Merge(src proto.Message)

func (*BlockSet) XXX_Size Uses

func (m *BlockSet) XXX_Size() int

func (*BlockSet) XXX_Unmarshal Uses

func (m *BlockSet) XXX_Unmarshal(b []byte) error

type Default Uses

type Default struct {
    Primary              *Spec    `protobuf:"bytes,1,opt,name=primary,proto3" json:"primary,omitempty"`
    Default              *Spec    `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Default spec type evaluates a sequence of nested specs in turn and returns the result of the first one that produces a non-null value. It creates no validation constraints of its own, but passes on the validation constraints from its first nested block.

“`hcl Default { Attr { name = "private" type = bool } Literal { value = false } } “`

A `Default` spec block must have at least one nested spec block, and should generally have at least two since otherwise the `Default` wrapper is a no-op.

The second and any subsequent spec blocks are _fallback_ specs. These exhibit their usual behavior but are not able to impose validation constraints on the current body since they are not evaluated unless all prior specs produce `null` as their result.

func (*Default) Descriptor Uses

func (*Default) Descriptor() ([]byte, []int)

func (*Default) GetDefault Uses

func (m *Default) GetDefault() *Spec

func (*Default) GetPrimary Uses

func (m *Default) GetPrimary() *Spec

func (*Default) ProtoMessage Uses

func (*Default) ProtoMessage()

func (*Default) Reset Uses

func (m *Default) Reset()

func (*Default) String Uses

func (m *Default) String() string

func (*Default) XXX_DiscardUnknown Uses

func (m *Default) XXX_DiscardUnknown()

func (*Default) XXX_Marshal Uses

func (m *Default) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Default) XXX_Merge Uses

func (m *Default) XXX_Merge(src proto.Message)

func (*Default) XXX_Size Uses

func (m *Default) XXX_Size() int

func (*Default) XXX_Unmarshal Uses

func (m *Default) XXX_Unmarshal(b []byte) error

type Literal Uses

type Literal struct {
    Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Literal spec type returns a given literal value, and creates no validation constraints. It is most commonly used with the `Default` spec type to create a fallback value, but can also be used e.g. to fill out required properties in an `Object` spec that do not correspond to any construct in the input configuration.

“`hcl Literal { value = "hello world" } “`

`Literal` spec blocks accept the following argument:

`value` (required) - The value to return. This attribute may be an expression that uses [functions](#spec-definition-functions).

`Literal` is a leaf spec type, so no nested spec blocks are permitted.

func (*Literal) Descriptor Uses

func (*Literal) Descriptor() ([]byte, []int)

func (*Literal) GetValue Uses

func (m *Literal) GetValue() string

func (*Literal) ProtoMessage Uses

func (*Literal) ProtoMessage()

func (*Literal) Reset Uses

func (m *Literal) Reset()

func (*Literal) String Uses

func (m *Literal) String() string

func (*Literal) XXX_DiscardUnknown Uses

func (m *Literal) XXX_DiscardUnknown()

func (*Literal) XXX_Marshal Uses

func (m *Literal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Literal) XXX_Merge Uses

func (m *Literal) XXX_Merge(src proto.Message)

func (*Literal) XXX_Size Uses

func (m *Literal) XXX_Size() int

func (*Literal) XXX_Unmarshal Uses

func (m *Literal) XXX_Unmarshal(b []byte) error

type Object Uses

type Object struct {
    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"`
    XXX_NoUnkeyedLiteral struct{}         `json:"-"`
    XXX_unrecognized     []byte           `json:"-"`
    XXX_sizecache        int32            `json:"-"`
}

Object spec type is the most commonly used at the root of a spec file. Its result is a JSON object whose properties are set based on any nested spec blocks:

“`hcl Object { Attr "name" { type = "string" } Block "address" { Object { Attr "street" { type = "string" } # ... } } } “`

Nested spec blocks inside `Object` must always have an extra block label `"name"`, `"address"` and `"street"` in the above example) that specifies the name of the property that should be created in the JSON object result. This label also acts as a default name selector for the nested spec, allowing the `Attr` blocks in the above example to omit the usually-required `name` argument in cases where the HCL input name and JSON output name are the same.

An `Object` spec block creates no validation constraints, but it passes on any validation constraints created by the nested specs.

func (*Object) Descriptor Uses

func (*Object) Descriptor() ([]byte, []int)

func (*Object) GetAttributes Uses

func (m *Object) GetAttributes() map[string]*Spec

func (*Object) ProtoMessage Uses

func (*Object) ProtoMessage()

func (*Object) Reset Uses

func (m *Object) Reset()

func (*Object) String Uses

func (m *Object) String() string

func (*Object) XXX_DiscardUnknown Uses

func (m *Object) XXX_DiscardUnknown()

func (*Object) XXX_Marshal Uses

func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Object) XXX_Merge Uses

func (m *Object) XXX_Merge(src proto.Message)

func (*Object) XXX_Size Uses

func (m *Object) XXX_Size() int

func (*Object) XXX_Unmarshal Uses

func (m *Object) XXX_Unmarshal(b []byte) error

type Spec Uses

type Spec struct {
    // Types that are valid to be assigned to Block:
    //	*Spec_Object
    //	*Spec_Array
    //	*Spec_Attr
    //	*Spec_BlockValue
    //	*Spec_BlockAttrs
    //	*Spec_BlockList
    //	*Spec_BlockSet
    //	*Spec_BlockMap
    //	*Spec_Default
    //	*Spec_Literal
    Block                isSpec_Block `protobuf_oneof:"block"`
    XXX_NoUnkeyedLiteral struct{}     `json:"-"`
    XXX_unrecognized     []byte       `json:"-"`
    XXX_sizecache        int32        `json:"-"`
}

Spec defines the available specification types.

func ArraySpec Uses

func ArraySpec(array *Array) *Spec

ArraySpec wraps the array and returns a spec.

func AttrSpec Uses

func AttrSpec(attr *Attr) *Spec

AttrSpec wraps the attr and returns a spec.

func BlockAttrsSpec Uses

func BlockAttrsSpec(blockAttrs *BlockAttrs) *Spec

BlockAttrsSpec wraps the block attrs and returns a spec.

func BlockListSpec Uses

func BlockListSpec(blockList *BlockList) *Spec

BlockListSpec wraps the block list and returns a spec.

func BlockMapSpec Uses

func BlockMapSpec(blockMap *BlockMap) *Spec

BlockMapSpec wraps the block map and returns a spec.

func BlockSetSpec Uses

func BlockSetSpec(blockSet *BlockSet) *Spec

BlockSetSpec wraps the block set and returns a spec.

func BlockSpec Uses

func BlockSpec(block *Block) *Spec

BlockSpec wraps the block and returns a spec.

func DefaultSpec Uses

func DefaultSpec(d *Default) *Spec

DefaultSpec wraps the default and returns a spec.

func LiteralSpec Uses

func LiteralSpec(l *Literal) *Spec

LiteralSpec wraps the literal and returns a spec.

func NewArray Uses

func NewArray(values []*Spec) *Spec

NewArray returns a new array spec.

func NewAttr Uses

func NewAttr(name, attrType string, required bool) *Spec

NewAttr returns a new attribute spec.

func NewBlock Uses

func NewBlock(name string, required bool, nested *Spec) *Spec

NewBlock returns a new block spec.

func NewBlockAttrs Uses

func NewBlockAttrs(name, elementType string, required bool) *Spec

NewBlockAttrs returns a new block attrs spec

func NewBlockList Uses

func NewBlockList(name string, nested *Spec) *Spec

NewBlockList returns a new block list spec that has no limits.

func NewBlockListLimited Uses

func NewBlockListLimited(name string, min, max uint64, nested *Spec) *Spec

NewBlockListLimited returns a new block list spec that limits the number of blocks.

func NewBlockMap Uses

func NewBlockMap(name string, labels []string, nested *Spec) *Spec

NewBlockMap returns a new block map spec.

func NewBlockSet Uses

func NewBlockSet(name string, nested *Spec) *Spec

NewBlockSet returns a new block set spec that has no limits.

func NewBlockSetLimited Uses

func NewBlockSetLimited(name string, min, max uint64, nested *Spec) *Spec

NewBlockSetLimited returns a new block set spec that limits the number of blocks.

func NewDefault Uses

func NewDefault(primary, defaultValue *Spec) *Spec

NewDefault returns a new default spec.

func NewLiteral Uses

func NewLiteral(value string) *Spec

NewLiteral returns a new literal spec.

func NewObject Uses

func NewObject(attrs map[string]*Spec) *Spec

NewObject returns a new object spec.

func ObjectSpec Uses

func ObjectSpec(obj *Object) *Spec

ObjectSpec wraps the object and returns a spec.

func (*Spec) Descriptor Uses

func (*Spec) Descriptor() ([]byte, []int)

func (*Spec) GetArray Uses

func (m *Spec) GetArray() *Array

func (*Spec) GetAttr Uses

func (m *Spec) GetAttr() *Attr

func (*Spec) GetBlock Uses

func (m *Spec) GetBlock() isSpec_Block

func (*Spec) GetBlockAttrs Uses

func (m *Spec) GetBlockAttrs() *BlockAttrs

func (*Spec) GetBlockList Uses

func (m *Spec) GetBlockList() *BlockList

func (*Spec) GetBlockMap Uses

func (m *Spec) GetBlockMap() *BlockMap

func (*Spec) GetBlockSet Uses

func (m *Spec) GetBlockSet() *BlockSet

func (*Spec) GetBlockValue Uses

func (m *Spec) GetBlockValue() *Block

func (*Spec) GetDefault Uses

func (m *Spec) GetDefault() *Default

func (*Spec) GetLiteral Uses

func (m *Spec) GetLiteral() *Literal

func (*Spec) GetObject Uses

func (m *Spec) GetObject() *Object

func (*Spec) ProtoMessage Uses

func (*Spec) ProtoMessage()

func (*Spec) Reset Uses

func (m *Spec) Reset()

func (*Spec) String Uses

func (m *Spec) String() string

func (*Spec) XXX_DiscardUnknown Uses

func (m *Spec) XXX_DiscardUnknown()

func (*Spec) XXX_Marshal Uses

func (m *Spec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Spec) XXX_Merge Uses

func (m *Spec) XXX_Merge(src proto.Message)

func (*Spec) XXX_OneofWrappers Uses

func (*Spec) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Spec) XXX_Size Uses

func (m *Spec) XXX_Size() int

func (*Spec) XXX_Unmarshal Uses

func (m *Spec) XXX_Unmarshal(b []byte) error

type Spec_Array Uses

type Spec_Array struct {
    Array *Array `protobuf:"bytes,2,opt,name=array,proto3,oneof"`
}

type Spec_Attr Uses

type Spec_Attr struct {
    Attr *Attr `protobuf:"bytes,3,opt,name=Attr,proto3,oneof"`
}

type Spec_BlockAttrs Uses

type Spec_BlockAttrs struct {
    BlockAttrs *BlockAttrs `protobuf:"bytes,5,opt,name=block_attrs,json=blockAttrs,proto3,oneof"`
}

type Spec_BlockList Uses

type Spec_BlockList struct {
    BlockList *BlockList `protobuf:"bytes,6,opt,name=block_list,json=blockList,proto3,oneof"`
}

type Spec_BlockMap Uses

type Spec_BlockMap struct {
    BlockMap *BlockMap `protobuf:"bytes,8,opt,name=block_map,json=blockMap,proto3,oneof"`
}

type Spec_BlockSet Uses

type Spec_BlockSet struct {
    BlockSet *BlockSet `protobuf:"bytes,7,opt,name=block_set,json=blockSet,proto3,oneof"`
}

type Spec_BlockValue Uses

type Spec_BlockValue struct {
    BlockValue *Block `protobuf:"bytes,4,opt,name=block_value,json=blockValue,proto3,oneof"`
}

type Spec_Default Uses

type Spec_Default struct {
    Default *Default `protobuf:"bytes,9,opt,name=default,proto3,oneof"`
}

type Spec_Literal Uses

type Spec_Literal struct {
    Literal *Literal `protobuf:"bytes,10,opt,name=literal,proto3,oneof"`
}

type Spec_Object Uses

type Spec_Object struct {
    Object *Object `protobuf:"bytes,1,opt,name=object,proto3,oneof"`
}

Package hclspec imports 3 packages (graph) and is imported by 54 packages. Updated 2020-11-26. Refresh now. Tools for package owners.