Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Marshal returns the Atlas HCL encoding of v. Marshal = schemaspec.MarshalerFunc(func(v interface{}) ([]byte, error) { r := &schemaspec.Resource{} if err := r.Scan(v); err != nil { return nil, fmt.Errorf("schemahcl: failed scanning %T to resource: %w", v, err) } return encode(r) }) )
View Source
var ( // Unmarshal parses the Atlas HCL-encoded data and stores the result in the target. Unmarshal = schemaspec.UnmarshalerFunc(func(data []byte, v interface{}) error { spec, err := decode(data) if err != nil { return fmt.Errorf("schemahcl: failed decoding: %w", err) } if err := spec.As(v); err != nil { return fmt.Errorf("schemahcl: failed reading spec as %T: %w", v, err) } return nil }) )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.