Documentation
¶
Index ¶
- Variables
- func Err(err error) error
- type Compiler
- func (c *Compiler) Compile(name string, src string) (*Value, error)
- func (c *Compiler) DecodeJSON(path string, data []byte) (*Value, error)
- func (c *Compiler) DecodeYAML(path string, data []byte) (*Value, error)
- func (c *Compiler) Err(err error) error
- func (c *Compiler) ErrInstance(err error, i *build.Instance) error
- func (c *Compiler) NewValue() *Value
- func (c *Compiler) Wrap(v cue.Value) *Value
- type ErrorInstance
- type Field
- type JSON
- type Value
- func Build(ctx context.Context, src string, overlays map[string]fs.FS, args ...string) (*Value, error)
- func Compile(name string, src string) (*Value, error)
- func DecodeJSON(path string, data []byte) (*Value, error)
- func DecodeYAML(path string, data []byte) (*Value, error)
- func NewValue() *Value
- func Wrap(v cue.Value) *Value
- func (v *Value) AbsPath() (string, error)
- func (v *Value) Bool() (bool, error)
- func (v *Value) Bytes() ([]byte, error)
- func (v *Value) Cue() cue.Value
- func (v *Value) Decode(x interface{}) error
- func (v *Value) Default() (*Value, bool)
- func (v *Value) Dereference() *Value
- func (v *Value) Dirname() (string, error)
- func (v *Value) Doc() []*ast.CommentGroup
- func (v *Value) DocSummary() string
- func (v *Value) Exists() bool
- func (v *Value) Expr() (cue.Op, []*Value)
- func (v *Value) Fields(opts ...cue.Option) ([]Field, error)
- func (v *Value) Filename() (string, error)
- func (v *Value) Fill(value interface{}) (*Value, error)
- func (v *Value) FillFields(values map[string]interface{}) (*Value, error)
- func (v *Value) FillPath(p cue.Path, x interface{}) error
- func (v *Value) HasAttr(filter ...string) bool
- func (v *Value) IncompleteKind() cue.Kind
- func (v *Value) Int64() (int64, error)
- func (v *Value) IsConcrete() bool
- func (v *Value) IsConcreteR(opts ...cue.Option) error
- func (v *Value) IsReference() bool
- func (v *Value) JSON() JSON
- func (v *Value) Kind() cue.Kind
- func (v *Value) Len() cue.Value
- func (v *Value) List() ([]*Value, error)
- func (v *Value) Lookup(path string) *Value
- func (v *Value) LookupPath(p cue.Path) *Value
- func (v *Value) Path() cue.Path
- func (v *Value) Pos() token.Pos
- func (v *Value) ReferencePath() (*Value, cue.Path)
- func (v *Value) Source(opts ...cue.Option) ([]byte, error)
- func (v *Value) String() (string, error)
- func (v *Value) Struct() (*cue.Struct, error)
- func (v *Value) Validate(opts ...cue.Option) error
- func (v *Value) Walk(before func(*Value) bool, after func(*Value))
Constants ¶
This section is empty.
Variables ¶
var DefaultCompiler = New()
DefaultCompiler is the default Compiler and is used by Compile
Functions ¶
Types ¶
type Compiler ¶
type Compiler struct {
*cue.Context
// contains filtered or unexported fields
}
Polyfill for a cue runtime (we call it compiler to avoid confusion with dagger runtime) Use this instead of cue.Runtime
func (*Compiler) DecodeJSON ¶
func (c *Compiler) DecodeJSON(path string, data []byte) (*Value, error)
func (*Compiler) DecodeYAML ¶
func (c *Compiler) DecodeYAML(path string, data []byte) (*Value, error)
func (*Compiler) ErrInstance ¶ added in v0.2.22
func (c *Compiler) ErrInstance(err error, i *build.Instance) error
type ErrorInstance ¶ added in v0.2.22
type ErrorInstance struct {
Err error
Instance *build.Instance
// contains filtered or unexported fields
}
type Field ¶
type Field struct {
Selector cue.Selector
Value *Value
IsOptional bool
}
Field represents a struct field
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is a wrapper around cue.Value. Use instead of cue.Value and cue.Instance
func Build ¶
func Build(ctx context.Context, src string, overlays map[string]fs.FS, args ...string) (*Value, error)
Build a cue configuration tree from the files in fs.
func DecodeJSON ¶
func DecodeJSON(path string, data []byte) (*Value, error)
func DecodeYAML ¶
func DecodeYAML(path string, data []byte) (*Value, error)
func (*Value) AbsPath ¶
func (v *Value) AbsPath() (string, error)
AbsPath returns an absolute path contained in Value Paths are relative to the CUE file they were declared in.
func (*Value) Bool ¶
func (v *Value) Bool() (bool, error)
Proxy function to the underlying cue.Value
func (*Value) Bytes ¶
func (v *Value) Bytes() ([]byte, error)
Proxy function to the underlying cue.Value
func (*Value) Decode ¶
func (v *Value) Decode(x interface{}) error
Proxy function to the underlying cue.Value
func (*Value) Dereference ¶
func (v *Value) Dereference() *Value
func (*Value) Dirname ¶
func (v *Value) Dirname() (string, error)
Dirname returns the CUE dirname where the value was defined
func (*Value) DocSummary ¶ added in v0.2.1
func (v *Value) DocSummary() string
DocSummary returns the first line of documentation
func (*Value) Expr ¶ added in v0.2.8
func (v *Value) Expr() (cue.Op, []*Value)
Proxy function to the underlying cue.Value
func (*Value) Fields ¶
func (v *Value) Fields(opts ...cue.Option) ([]Field, error)
Proxy function to the underlying cue.Value Field ordering is guaranteed to be stable.
func (*Value) Filename ¶
func (v *Value) Filename() (string, error)
Filename returns the CUE filename where the value was defined
func (*Value) Fill ¶ added in v0.2.0
func (v *Value) Fill(value interface{}) (*Value, error)
Fill updates a value, in place
func (*Value) FillFields ¶
func (v *Value) FillFields(values map[string]interface{}) (*Value, error)
FillFields fills multiple fields, in place
func (*Value) FillPath ¶
func (v *Value) FillPath(p cue.Path, x interface{}) error
FillPath fills the value in-place
func (*Value) HasAttr ¶
func (v *Value) HasAttr(filter ...string) bool
Returns true if value has a dagger attribute (eg. artifact, secret, input)
func (*Value) IncompleteKind ¶
func (v *Value) IncompleteKind() cue.Kind
Proxy function to the underlying cue.Value
func (*Value) Int64 ¶
func (v *Value) Int64() (int64, error)
Proxy function to the underlying cue.Value
func (*Value) IsConcrete ¶
func (v *Value) IsConcrete() bool
func (*Value) IsConcreteR ¶
func (v *Value) IsConcreteR(opts ...cue.Option) error
Recursive concreteness check.
func (*Value) IsReference ¶ added in v0.2.11
func (v *Value) IsReference() bool
func (*Value) JSON ¶
func (v *Value) JSON() JSON
Export concrete values to JSON. ignoring non-concrete values. Contrast with cue.Value.MarshalJSON which requires all values to be concrete.
func (*Value) Lookup ¶
func (v *Value) Lookup(path string) *Value
Lookup is a helper function to lookup by path parts.
func (*Value) LookupPath ¶
func (v *Value) LookupPath(p cue.Path) *Value
LookupPath is a concurrency safe wrapper around cue.Value.LookupPath
func (*Value) ReferencePath ¶
func (v *Value) ReferencePath() (*Value, cue.Path)
func (*Value) Source ¶
func (v *Value) Source(opts ...cue.Option) ([]byte, error)
Return cue source for this value
func (*Value) String ¶
func (v *Value) String() (string, error)
Proxy function to the underlying cue.Value
func (*Value) Struct ¶
func (v *Value) Struct() (*cue.Struct, error)
Proxy function to the underlying cue.Value