hclspec

package
v1.2.0-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2021 License: MPL-2.0 Imports: 3 Imported by: 392

Documentation

Index

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) Descriptor() ([]byte, []int)

func (*Array) GetValues

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

func (*Array) ProtoMessage

func (*Array) ProtoMessage()

func (*Array) Reset

func (m *Array) Reset()

func (*Array) String

func (m *Array) String() string

func (*Array) XXX_DiscardUnknown

func (m *Array) XXX_DiscardUnknown()

func (*Array) XXX_Marshal

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

func (*Array) XXX_Merge

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

func (*Array) XXX_Size

func (m *Array) XXX_Size() int

func (*Array) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Attr) GetName

func (m *Attr) GetName() string

func (*Attr) GetRequired

func (m *Attr) GetRequired() bool

func (*Attr) GetType

func (m *Attr) GetType() string

func (*Attr) ProtoMessage

func (*Attr) ProtoMessage()

func (*Attr) Reset

func (m *Attr) Reset()

func (*Attr) String

func (m *Attr) String() string

func (*Attr) XXX_DiscardUnknown

func (m *Attr) XXX_DiscardUnknown()

func (*Attr) XXX_Marshal

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

func (*Attr) XXX_Merge

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

func (*Attr) XXX_Size

func (m *Attr) XXX_Size() int

func (*Attr) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Block) GetName

func (m *Block) GetName() string

func (*Block) GetNested

func (m *Block) GetNested() *Spec

func (*Block) GetRequired

func (m *Block) GetRequired() bool

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) String

func (m *Block) String() string

func (*Block) XXX_DiscardUnknown

func (m *Block) XXX_DiscardUnknown()

func (*Block) XXX_Marshal

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

func (*Block) XXX_Merge

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

func (*Block) XXX_Size

func (m *Block) XXX_Size() int

func (*Block) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*BlockList) GetMaxItems

func (m *BlockList) GetMaxItems() uint64

func (*BlockList) GetMinItems

func (m *BlockList) GetMinItems() uint64

func (*BlockList) GetName

func (m *BlockList) GetName() string

func (*BlockList) GetNested

func (m *BlockList) GetNested() *Spec

func (*BlockList) ProtoMessage

func (*BlockList) ProtoMessage()

func (*BlockList) Reset

func (m *BlockList) Reset()

func (*BlockList) String

func (m *BlockList) String() string

func (*BlockList) XXX_DiscardUnknown

func (m *BlockList) XXX_DiscardUnknown()

func (*BlockList) XXX_Marshal

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

func (*BlockList) XXX_Merge

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

func (*BlockList) XXX_Size

func (m *BlockList) XXX_Size() int

func (*BlockList) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*BlockMap) GetLabels

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

func (*BlockMap) GetName

func (m *BlockMap) GetName() string

func (*BlockMap) GetNested

func (m *BlockMap) GetNested() *Spec

func (*BlockMap) ProtoMessage

func (*BlockMap) ProtoMessage()

func (*BlockMap) Reset

func (m *BlockMap) Reset()

func (*BlockMap) String

func (m *BlockMap) String() string

func (*BlockMap) XXX_DiscardUnknown

func (m *BlockMap) XXX_DiscardUnknown()

func (*BlockMap) XXX_Marshal

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

func (*BlockMap) XXX_Merge

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

func (*BlockMap) XXX_Size

func (m *BlockMap) XXX_Size() int

func (*BlockMap) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*BlockSet) GetMaxItems

func (m *BlockSet) GetMaxItems() uint64

func (*BlockSet) GetMinItems

func (m *BlockSet) GetMinItems() uint64

func (*BlockSet) GetName

func (m *BlockSet) GetName() string

func (*BlockSet) GetNested

func (m *BlockSet) GetNested() *Spec

func (*BlockSet) ProtoMessage

func (*BlockSet) ProtoMessage()

func (*BlockSet) Reset

func (m *BlockSet) Reset()

func (*BlockSet) String

func (m *BlockSet) String() string

func (*BlockSet) XXX_DiscardUnknown

func (m *BlockSet) XXX_DiscardUnknown()

func (*BlockSet) XXX_Marshal

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

func (*BlockSet) XXX_Merge

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

func (*BlockSet) XXX_Size

func (m *BlockSet) XXX_Size() int

func (*BlockSet) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Default) GetDefault

func (m *Default) GetDefault() *Spec

func (*Default) GetPrimary

func (m *Default) GetPrimary() *Spec

func (*Default) ProtoMessage

func (*Default) ProtoMessage()

func (*Default) Reset

func (m *Default) Reset()

func (*Default) String

func (m *Default) String() string

func (*Default) XXX_DiscardUnknown

func (m *Default) XXX_DiscardUnknown()

func (*Default) XXX_Marshal

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

func (*Default) XXX_Merge

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

func (*Default) XXX_Size

func (m *Default) XXX_Size() int

func (*Default) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Literal) GetValue

func (m *Literal) GetValue() string

func (*Literal) ProtoMessage

func (*Literal) ProtoMessage()

func (*Literal) Reset

func (m *Literal) Reset()

func (*Literal) String

func (m *Literal) String() string

func (*Literal) XXX_DiscardUnknown

func (m *Literal) XXX_DiscardUnknown()

func (*Literal) XXX_Marshal

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

func (*Literal) XXX_Merge

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

func (*Literal) XXX_Size

func (m *Literal) XXX_Size() int

func (*Literal) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Object) GetAttributes

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

func (*Object) ProtoMessage

func (*Object) ProtoMessage()

func (*Object) Reset

func (m *Object) Reset()

func (*Object) String

func (m *Object) String() string

func (*Object) XXX_DiscardUnknown

func (m *Object) XXX_DiscardUnknown()

func (*Object) XXX_Marshal

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

func (*Object) XXX_Merge

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

func (*Object) XXX_Size

func (m *Object) XXX_Size() int

func (*Object) XXX_Unmarshal

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

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 ArraySpec

func ArraySpec(array *Array) *Spec

ArraySpec wraps the array and returns a spec.

func AttrSpec

func AttrSpec(attr *Attr) *Spec

AttrSpec wraps the attr and returns a spec.

func BlockAttrsSpec

func BlockAttrsSpec(blockAttrs *BlockAttrs) *Spec

BlockAttrsSpec wraps the block attrs and returns a spec.

func BlockListSpec

func BlockListSpec(blockList *BlockList) *Spec

BlockListSpec wraps the block list and returns a spec.

func BlockMapSpec

func BlockMapSpec(blockMap *BlockMap) *Spec

BlockMapSpec wraps the block map and returns a spec.

func BlockSetSpec

func BlockSetSpec(blockSet *BlockSet) *Spec

BlockSetSpec wraps the block set and returns a spec.

func BlockSpec

func BlockSpec(block *Block) *Spec

BlockSpec wraps the block and returns a spec.

func DefaultSpec

func DefaultSpec(d *Default) *Spec

DefaultSpec wraps the default and returns a spec.

func LiteralSpec

func LiteralSpec(l *Literal) *Spec

LiteralSpec wraps the literal and returns a spec.

func NewArray

func NewArray(values []*Spec) *Spec

NewArray returns a new array spec.

func NewAttr

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

NewAttr returns a new attribute spec.

func NewBlock

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

NewBlock returns a new block spec.

func NewBlockAttrs

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

NewBlockAttrs returns a new block attrs spec

func NewBlockList

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

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

func NewBlockListLimited

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

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

NewBlockMap returns a new block map spec.

func NewBlockSet

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

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

func NewBlockSetLimited

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

func NewDefault(primary, defaultValue *Spec) *Spec

NewDefault returns a new default spec.

func NewLiteral

func NewLiteral(value string) *Spec

NewLiteral returns a new literal spec.

func NewObject

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

NewObject returns a new object spec.

func ObjectSpec

func ObjectSpec(obj *Object) *Spec

ObjectSpec wraps the object and returns a spec.

func (*Spec) Descriptor

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

func (*Spec) GetArray

func (m *Spec) GetArray() *Array

func (*Spec) GetAttr

func (m *Spec) GetAttr() *Attr

func (*Spec) GetBlock

func (m *Spec) GetBlock() isSpec_Block

func (*Spec) GetBlockAttrs

func (m *Spec) GetBlockAttrs() *BlockAttrs

func (*Spec) GetBlockList

func (m *Spec) GetBlockList() *BlockList

func (*Spec) GetBlockMap

func (m *Spec) GetBlockMap() *BlockMap

func (*Spec) GetBlockSet

func (m *Spec) GetBlockSet() *BlockSet

func (*Spec) GetBlockValue

func (m *Spec) GetBlockValue() *Block

func (*Spec) GetDefault

func (m *Spec) GetDefault() *Default

func (*Spec) GetLiteral

func (m *Spec) GetLiteral() *Literal

func (*Spec) GetObject

func (m *Spec) GetObject() *Object

func (*Spec) ProtoMessage

func (*Spec) ProtoMessage()

func (*Spec) Reset

func (m *Spec) Reset()

func (*Spec) String

func (m *Spec) String() string

func (*Spec) XXX_DiscardUnknown

func (m *Spec) XXX_DiscardUnknown()

func (*Spec) XXX_Marshal

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

func (*Spec) XXX_Merge

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

func (*Spec) XXX_OneofWrappers added in v0.11.0

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*Spec) XXX_Size

func (m *Spec) XXX_Size() int

func (*Spec) XXX_Unmarshal

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

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL