Versions in this module Expand all Collapse all v0 v0.0.3 Oct 29, 2024 v0.0.2 Oct 24, 2024 v0.0.1 Oct 24, 2024 Changes in this version + const AttrName + const BlockData + const BlockLocals + const BlockVariable + const RefData + const RefLocal + const RefVar + var Marshal = MarshalerFunc(New().MarshalSpec) + func MakeFileFunc(base string) function.Function + func RawExprValue(x *RawExpr) cty.Value + func RefValue(v string) cty.Value + func Register(name string, ext any) + func TypeValue(t *Type) cty.Value + type Attr struct + K string + V cty.Value + func BoolAttr(k string, v bool) *Attr + func Int64Attr(k string, v int64) *Attr + func IntAttr(k string, v int) *Attr + func RawAttr(k string, x string) *Attr + func RefAttr(k string, v *Ref) *Attr + func RefsAttr(k string, refs ...*Ref) *Attr + func StringAttr(k string, v string) *Attr + func StringsAttr(k string, vs ...string) *Attr + func (a *Attr) Bool() (b bool, err error) + func (a *Attr) Bools() (vs []bool, err error) + func (a *Attr) Int() (int, error) + func (a *Attr) Int64() (i int64, err error) + func (a *Attr) IsRawExpr() bool + func (a *Attr) IsRef() bool + func (a *Attr) IsType() bool + func (a *Attr) RawExpr() (*RawExpr, error) + func (a *Attr) Ref() (string, error) + func (a *Attr) Refs() ([]*Ref, error) + func (a *Attr) String() (s string, err error) + func (a *Attr) Strings() (vs []string, err error) + func (a *Attr) Type() (*Type, error) + type Config struct + type DefaultExtension struct + Extra Resource + func (d *DefaultExtension) Attr(name string) (*Attr, bool) + func (d *DefaultExtension) Remain() *Resource + type EvalFunc func(*hclparse.Parser, any, map[string]cty.Value) error + func (f EvalFunc) Eval(p *hclparse.Parser, i any, input map[string]cty.Value) error + type Evaluator interface + Eval func(*hclparse.Parser, any, map[string]cty.Value) error + type Marshaler interface + MarshalSpec func(any) ([]byte, error) + type MarshalerFunc func(any) ([]byte, error) + func (f MarshalerFunc) MarshalSpec(v any) ([]byte, error) + type Option func(*Config) + func WithDataSource(name string, h func(*hcl.EvalContext, *hclsyntax.Block) (cty.Value, error)) Option + func WithFunctions(funcs map[string]function.Function) Option + func WithInitBlock(name string, h func(*hcl.EvalContext, *hclsyntax.Block) (cty.Value, error)) Option + func WithSchemaValidator(v func() SchemaValidator) Option + func WithScopedEnums[T interface{ ... }](path string, enums ...T) Option + func WithTypeLabelBlock(name, label string, ...) Option + func WithTypes(path string, typeSpecs []*TypeSpec) Option + func WithVariables(vars map[string]cty.Value) Option + type PathIndex struct + T string + V []string + func (p *PathIndex) Check() error + type RawExpr struct + X string + type Ref struct + V string + func BuildRef(path []PathIndex) *Ref + func (r *Ref) ByType(name string) ([]string, error) + func (r *Ref) Path() (path []PathIndex, err error) + type Remainer interface + Remain func() *Resource + type Resource struct + Attrs []*Attr + Children []*Resource + Name string + Qualifier string + Type string + func (r *Resource) As(target any) error + func (r *Resource) Attr(name string) (*Attr, bool) + func (r *Resource) EmbedAttr(attr *Attr) + func (r *Resource) FinalName() (string, error) + func (r *Resource) Resource(t string) (*Resource, bool) + func (r *Resource) Scan(ext any) error + func (r *Resource) SetAttr(attr *Attr) + type SchemaValidator interface + Err func() error + ValidateAttribute func(*hcl.EvalContext, *hclsyntax.Attribute, cty.Value) error + ValidateBlock func(*hcl.EvalContext, *hclsyntax.Block) (func() error, error) + ValidateBody func(*hcl.EvalContext, *hclsyntax.Body) (func() error, error) + type State struct + func New(opts ...Option) *State + func (s *State) Eval(parsed *hclparse.Parser, v any, input map[string]cty.Value) error + func (s *State) EvalBytes(data []byte, v any, input map[string]cty.Value) error + func (s *State) EvalFiles(paths []string, v any, input map[string]cty.Value) error + func (s *State) MarshalSpec(v any) ([]byte, error) + type Type struct + Attrs []*Attr + IsRef bool + T string + func (t *Type) IsRefTo(n string) bool + type TypeAttr struct + Kind reflect.Kind + Name string + Required bool + func PrecisionTypeAttr() *TypeAttr + func ScaleTypeAttr() *TypeAttr + func SizeTypeAttr(required bool) *TypeAttr + type TypeRegistry struct + func NewRegistry(opts ...TypeRegistryOption) *TypeRegistry + func (r *TypeRegistry) Convert(typ schema.Type) (*Type, error) + func (r *TypeRegistry) PrintType(typ *Type) (string, error) + func (r *TypeRegistry) Register(specs ...*TypeSpec) error + func (r *TypeRegistry) Specs() []*TypeSpec + func (r *TypeRegistry) Type(typ *Type, extra []*Attr) (schema.Type, error) + type TypeRegistryOption func(*TypeRegistry) error + func WithFormatter(f func(schema.Type) (string, error)) TypeRegistryOption + func WithParser(parser func(string) (schema.Type, error)) TypeRegistryOption + func WithSpecFunc(spec func(schema.Type) (*Type, error)) TypeRegistryOption + func WithSpecs(specs ...*TypeSpec) TypeRegistryOption + type TypeSpec struct + Attributes []*TypeAttr + Format func(*Type) (string, error) + FromSpec func(*Type) (schema.Type, error) + Name string + RType reflect.Type + T string + ToSpec func(schema.Type) (*Type, error) + func AliasTypeSpec(name, dbType string, opts ...TypeSpecOption) *TypeSpec + func NewTypeSpec(name string, opts ...TypeSpecOption) *TypeSpec + func (s *TypeSpec) Attr(name string) (*TypeAttr, bool) + type TypeSpecOption func(*TypeSpec) + func WithAttributes(attrs ...*TypeAttr) TypeSpecOption + func WithFromSpec(f func(*Type) (schema.Type, error)) TypeSpecOption + func WithToSpec(f func(schema.Type) (*Type, error)) TypeSpecOption + func WithTypeFormatter(f func(*Type) (string, error)) TypeSpecOption + type Variables struct + Data map[string]map[string]bool + Local map[string]bool + Var map[string]bool