Documentation ¶
Index ¶
- type Array
- func (*Array) Descriptor() ([]byte, []int)
- func (m *Array) GetValues() []*Spec
- func (*Array) ProtoMessage()
- func (m *Array) Reset()
- func (m *Array) String() string
- func (m *Array) XXX_DiscardUnknown()
- func (m *Array) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Array) XXX_Merge(src proto.Message)
- func (m *Array) XXX_Size() int
- func (m *Array) XXX_Unmarshal(b []byte) error
- type Attr
- func (*Attr) Descriptor() ([]byte, []int)
- func (m *Attr) GetName() string
- func (m *Attr) GetRequired() bool
- func (m *Attr) GetType() string
- func (*Attr) ProtoMessage()
- func (m *Attr) Reset()
- func (m *Attr) String() string
- func (m *Attr) XXX_DiscardUnknown()
- func (m *Attr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Attr) XXX_Merge(src proto.Message)
- func (m *Attr) XXX_Size() int
- func (m *Attr) XXX_Unmarshal(b []byte) error
- type Block
- func (*Block) Descriptor() ([]byte, []int)
- func (m *Block) GetName() string
- func (m *Block) GetNested() *Spec
- func (m *Block) GetRequired() bool
- func (*Block) ProtoMessage()
- func (m *Block) Reset()
- func (m *Block) String() string
- func (m *Block) XXX_DiscardUnknown()
- func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Block) XXX_Merge(src proto.Message)
- func (m *Block) XXX_Size() int
- func (m *Block) XXX_Unmarshal(b []byte) error
- type BlockAttrs
- func (*BlockAttrs) Descriptor() ([]byte, []int)
- func (m *BlockAttrs) GetName() string
- func (m *BlockAttrs) GetRequired() bool
- func (m *BlockAttrs) GetType() string
- func (*BlockAttrs) ProtoMessage()
- func (m *BlockAttrs) Reset()
- func (m *BlockAttrs) String() string
- func (m *BlockAttrs) XXX_DiscardUnknown()
- func (m *BlockAttrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockAttrs) XXX_Merge(src proto.Message)
- func (m *BlockAttrs) XXX_Size() int
- func (m *BlockAttrs) XXX_Unmarshal(b []byte) error
- type BlockList
- func (*BlockList) Descriptor() ([]byte, []int)
- func (m *BlockList) GetMaxItems() uint64
- func (m *BlockList) GetMinItems() uint64
- func (m *BlockList) GetName() string
- func (m *BlockList) GetNested() *Spec
- func (*BlockList) ProtoMessage()
- func (m *BlockList) Reset()
- func (m *BlockList) String() string
- func (m *BlockList) XXX_DiscardUnknown()
- func (m *BlockList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockList) XXX_Merge(src proto.Message)
- func (m *BlockList) XXX_Size() int
- func (m *BlockList) XXX_Unmarshal(b []byte) error
- type BlockMap
- func (*BlockMap) Descriptor() ([]byte, []int)
- func (m *BlockMap) GetLabels() []string
- func (m *BlockMap) GetName() string
- func (m *BlockMap) GetNested() *Spec
- func (*BlockMap) ProtoMessage()
- func (m *BlockMap) Reset()
- func (m *BlockMap) String() string
- func (m *BlockMap) XXX_DiscardUnknown()
- func (m *BlockMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockMap) XXX_Merge(src proto.Message)
- func (m *BlockMap) XXX_Size() int
- func (m *BlockMap) XXX_Unmarshal(b []byte) error
- type BlockSet
- func (*BlockSet) Descriptor() ([]byte, []int)
- func (m *BlockSet) GetMaxItems() uint64
- func (m *BlockSet) GetMinItems() uint64
- func (m *BlockSet) GetName() string
- func (m *BlockSet) GetNested() *Spec
- func (*BlockSet) ProtoMessage()
- func (m *BlockSet) Reset()
- func (m *BlockSet) String() string
- func (m *BlockSet) XXX_DiscardUnknown()
- func (m *BlockSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockSet) XXX_Merge(src proto.Message)
- func (m *BlockSet) XXX_Size() int
- func (m *BlockSet) XXX_Unmarshal(b []byte) error
- type Default
- func (*Default) Descriptor() ([]byte, []int)
- func (m *Default) GetDefault() *Spec
- func (m *Default) GetPrimary() *Spec
- func (*Default) ProtoMessage()
- func (m *Default) Reset()
- func (m *Default) String() string
- func (m *Default) XXX_DiscardUnknown()
- func (m *Default) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Default) XXX_Merge(src proto.Message)
- func (m *Default) XXX_Size() int
- func (m *Default) XXX_Unmarshal(b []byte) error
- type Literal
- func (*Literal) Descriptor() ([]byte, []int)
- func (m *Literal) GetValue() string
- func (*Literal) ProtoMessage()
- func (m *Literal) Reset()
- func (m *Literal) String() string
- func (m *Literal) XXX_DiscardUnknown()
- func (m *Literal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Literal) XXX_Merge(src proto.Message)
- func (m *Literal) XXX_Size() int
- func (m *Literal) XXX_Unmarshal(b []byte) error
- type Object
- func (*Object) Descriptor() ([]byte, []int)
- func (m *Object) GetAttributes() map[string]*Spec
- func (*Object) ProtoMessage()
- func (m *Object) Reset()
- func (m *Object) String() string
- func (m *Object) XXX_DiscardUnknown()
- func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Object) XXX_Merge(src proto.Message)
- func (m *Object) XXX_Size() int
- func (m *Object) XXX_Unmarshal(b []byte) error
- type Spec
- func ArraySpec(array *Array) *Spec
- func AttrSpec(attr *Attr) *Spec
- func BlockAttrsSpec(blockAttrs *BlockAttrs) *Spec
- func BlockListSpec(blockList *BlockList) *Spec
- func BlockMapSpec(blockMap *BlockMap) *Spec
- func BlockSetSpec(blockSet *BlockSet) *Spec
- func BlockSpec(block *Block) *Spec
- func DefaultSpec(d *Default) *Spec
- func LiteralSpec(l *Literal) *Spec
- func NewArray(values []*Spec) *Spec
- func NewAttr(name, attrType string, required bool) *Spec
- func NewBlock(name string, required bool, nested *Spec) *Spec
- func NewBlockAttrs(name, elementType string, required bool) *Spec
- func NewBlockList(name string, nested *Spec) *Spec
- func NewBlockListLimited(name string, min, max uint64, nested *Spec) *Spec
- func NewBlockMap(name string, labels []string, nested *Spec) *Spec
- func NewBlockSet(name string, nested *Spec) *Spec
- func NewBlockSetLimited(name string, min, max uint64, nested *Spec) *Spec
- func NewDefault(primary, defaultValue *Spec) *Spec
- func NewLiteral(value string) *Spec
- func NewObject(attrs map[string]*Spec) *Spec
- func ObjectSpec(obj *Object) *Spec
- func (*Spec) Descriptor() ([]byte, []int)
- func (m *Spec) GetArray() *Array
- func (m *Spec) GetAttr() *Attr
- func (m *Spec) GetBlock() isSpec_Block
- func (m *Spec) GetBlockAttrs() *BlockAttrs
- func (m *Spec) GetBlockList() *BlockList
- func (m *Spec) GetBlockMap() *BlockMap
- func (m *Spec) GetBlockSet() *BlockSet
- func (m *Spec) GetBlockValue() *Block
- func (m *Spec) GetDefault() *Default
- func (m *Spec) GetLiteral() *Literal
- func (m *Spec) GetObject() *Object
- func (*Spec) ProtoMessage()
- func (m *Spec) Reset()
- func (m *Spec) String() string
- func (m *Spec) XXX_DiscardUnknown()
- func (m *Spec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Spec) XXX_Merge(src proto.Message)
- func (*Spec) XXX_OneofWrappers() []interface{}
- func (m *Spec) XXX_Size() int
- func (m *Spec) XXX_Unmarshal(b []byte) error
- type Spec_Array
- type Spec_Attr
- type Spec_BlockAttrs
- type Spec_BlockList
- type Spec_BlockMap
- type Spec_BlockSet
- type Spec_BlockValue
- type Spec_Default
- type Spec_Literal
- type Spec_Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
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 ¶
func (*Array) ProtoMessage ¶
func (*Array) ProtoMessage()
func (*Array) XXX_DiscardUnknown ¶
func (m *Array) XXX_DiscardUnknown()
func (*Array) XXX_Marshal ¶
func (*Array) XXX_Unmarshal ¶
type Attr ¶
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 ¶
func (*Attr) GetRequired ¶
func (*Attr) ProtoMessage ¶
func (*Attr) ProtoMessage()
func (*Attr) XXX_DiscardUnknown ¶
func (m *Attr) XXX_DiscardUnknown()
func (*Attr) XXX_Unmarshal ¶
type Block ¶
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 ¶
func (*Block) GetRequired ¶
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) XXX_DiscardUnknown ¶
func (m *Block) XXX_DiscardUnknown()
func (*Block) XXX_Marshal ¶
func (*Block) XXX_Unmarshal ¶
type BlockAttrs ¶
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 ¶
func (*BlockAttrs) Descriptor() ([]byte, []int)
func (*BlockAttrs) GetName ¶
func (m *BlockAttrs) GetName() string
func (*BlockAttrs) GetRequired ¶
func (m *BlockAttrs) GetRequired() bool
func (*BlockAttrs) GetType ¶
func (m *BlockAttrs) GetType() string
func (*BlockAttrs) ProtoMessage ¶
func (*BlockAttrs) ProtoMessage()
func (*BlockAttrs) Reset ¶
func (m *BlockAttrs) Reset()
func (*BlockAttrs) String ¶
func (m *BlockAttrs) String() string
func (*BlockAttrs) XXX_DiscardUnknown ¶
func (m *BlockAttrs) XXX_DiscardUnknown()
func (*BlockAttrs) XXX_Marshal ¶
func (m *BlockAttrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BlockAttrs) XXX_Merge ¶
func (m *BlockAttrs) XXX_Merge(src proto.Message)
func (*BlockAttrs) XXX_Size ¶
func (m *BlockAttrs) XXX_Size() int
func (*BlockAttrs) XXX_Unmarshal ¶
func (m *BlockAttrs) XXX_Unmarshal(b []byte) error
type BlockList ¶
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 ¶
func (*BlockList) GetMaxItems ¶
func (*BlockList) GetMinItems ¶
func (*BlockList) ProtoMessage ¶
func (*BlockList) ProtoMessage()
func (*BlockList) XXX_DiscardUnknown ¶
func (m *BlockList) XXX_DiscardUnknown()
func (*BlockList) XXX_Marshal ¶
func (*BlockList) XXX_Unmarshal ¶
type BlockMap ¶
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 ¶
func (*BlockMap) ProtoMessage ¶
func (*BlockMap) ProtoMessage()
func (*BlockMap) XXX_DiscardUnknown ¶
func (m *BlockMap) XXX_DiscardUnknown()
func (*BlockMap) XXX_Marshal ¶
func (*BlockMap) XXX_Unmarshal ¶
type BlockSet ¶
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 ¶
func (*BlockSet) GetMaxItems ¶
func (*BlockSet) GetMinItems ¶
func (*BlockSet) ProtoMessage ¶
func (*BlockSet) ProtoMessage()
func (*BlockSet) XXX_DiscardUnknown ¶
func (m *BlockSet) XXX_DiscardUnknown()
func (*BlockSet) XXX_Marshal ¶
func (*BlockSet) XXX_Unmarshal ¶
type Default ¶
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 ¶
func (*Default) GetDefault ¶
func (*Default) GetPrimary ¶
func (*Default) ProtoMessage ¶
func (*Default) ProtoMessage()
func (*Default) XXX_DiscardUnknown ¶
func (m *Default) XXX_DiscardUnknown()
func (*Default) XXX_Marshal ¶
func (*Default) XXX_Unmarshal ¶
type Literal ¶
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 ¶
func (*Literal) ProtoMessage ¶
func (*Literal) ProtoMessage()
func (*Literal) XXX_DiscardUnknown ¶
func (m *Literal) XXX_DiscardUnknown()
func (*Literal) XXX_Marshal ¶
func (*Literal) XXX_Unmarshal ¶
type Object ¶
type Object struct { Attributes map[string]*Spec `` /* 161-byte string literal not displayed */ 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 ¶
func (*Object) GetAttributes ¶
func (*Object) ProtoMessage ¶
func (*Object) ProtoMessage()
func (*Object) XXX_DiscardUnknown ¶
func (m *Object) XXX_DiscardUnknown()
func (*Object) XXX_Marshal ¶
func (*Object) XXX_Unmarshal ¶
type Spec ¶
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 BlockAttrsSpec ¶
func BlockAttrsSpec(blockAttrs *BlockAttrs) *Spec
BlockAttrsSpec wraps the block attrs and returns a spec.
func BlockListSpec ¶
BlockListSpec wraps the block list and returns a spec.
func BlockMapSpec ¶
BlockMapSpec wraps the block map and returns a spec.
func BlockSetSpec ¶
BlockSetSpec wraps the block set and returns a spec.
func DefaultSpec ¶
DefaultSpec wraps the default and returns a spec.
func LiteralSpec ¶
LiteralSpec wraps the literal and returns a spec.
func NewBlockAttrs ¶
NewBlockAttrs returns a new block attrs spec
func NewBlockList ¶
NewBlockList returns a new block list spec that has no limits.
func NewBlockListLimited ¶
NewBlockListLimited returns a new block list spec that limits the number of blocks.
func NewBlockMap ¶
NewBlockMap returns a new block map spec.
func NewBlockSet ¶
NewBlockSet returns a new block set spec that has no limits.
func NewBlockSetLimited ¶
NewBlockSetLimited returns a new block set spec that limits the number of blocks.
func NewDefault ¶
NewDefault returns a new default spec.
func ObjectSpec ¶
ObjectSpec wraps the object and returns a spec.
func (*Spec) Descriptor ¶
func (*Spec) GetBlockAttrs ¶
func (m *Spec) GetBlockAttrs() *BlockAttrs
func (*Spec) GetBlockList ¶
func (*Spec) GetBlockMap ¶
func (*Spec) GetBlockSet ¶
func (*Spec) GetBlockValue ¶
func (*Spec) GetDefault ¶
func (*Spec) GetLiteral ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) XXX_DiscardUnknown ¶
func (m *Spec) XXX_DiscardUnknown()
func (*Spec) XXX_OneofWrappers ¶ added in v0.11.2
func (*Spec) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Spec) XXX_Unmarshal ¶
type Spec_Array ¶
type Spec_Array struct {
Array *Array `protobuf:"bytes,2,opt,name=array,proto3,oneof"`
}
type Spec_Attr ¶
type Spec_Attr struct {
Attr *Attr `protobuf:"bytes,3,opt,name=Attr,proto3,oneof"`
}
type Spec_BlockAttrs ¶
type Spec_BlockAttrs struct {
BlockAttrs *BlockAttrs `protobuf:"bytes,5,opt,name=block_attrs,json=blockAttrs,proto3,oneof"`
}
type Spec_BlockList ¶
type Spec_BlockList struct {
BlockList *BlockList `protobuf:"bytes,6,opt,name=block_list,json=blockList,proto3,oneof"`
}
type Spec_BlockMap ¶
type Spec_BlockMap struct {
BlockMap *BlockMap `protobuf:"bytes,8,opt,name=block_map,json=blockMap,proto3,oneof"`
}
type Spec_BlockSet ¶
type Spec_BlockSet struct {
BlockSet *BlockSet `protobuf:"bytes,7,opt,name=block_set,json=blockSet,proto3,oneof"`
}
type Spec_BlockValue ¶
type Spec_BlockValue struct {
BlockValue *Block `protobuf:"bytes,4,opt,name=block_value,json=blockValue,proto3,oneof"`
}
type Spec_Default ¶
type Spec_Default struct {
Default *Default `protobuf:"bytes,9,opt,name=default,proto3,oneof"`
}
type Spec_Literal ¶
type Spec_Literal struct {
Literal *Literal `protobuf:"bytes,10,opt,name=literal,proto3,oneof"`
}
type Spec_Object ¶
type Spec_Object struct {
Object *Object `protobuf:"bytes,1,opt,name=object,proto3,oneof"`
}