Documentation ¶
Index ¶
- Variables
- func AttrToMap(A cue.Attribute) (m map[string]string)
- func CueErrorToString(err error) string
- func CueSyntax(val cue.Value, opts []cue.Option) ast.Node
- func ExpandCueError(err error) error
- func FindModuleAbsPath(dir string) (string, error)
- func FormatCue(val cue.Value) (string, error)
- func FormatOutput(val cue.Value, format string) (string, error)
- func PrintAttr(attr cue.Attribute, val cue.Value) error
- func PrintCue(val cue.Value) (string, error)
- func PrintCueError(err error)
- func PrintCueValue(val cue.Value) (string, error)
- func RunDefFromArgs(args []string) error
- func RunEvalFromArgs(args []string) error
- func RunExportFromArgs(args []string) error
- func RunTrimFromArgs(args []string) error
- func RunVetFromArgs(args []string) error
- func ToFile(n ast.Node) *ast.File
- func ValueToSyntaxString(val cue.Value, opts ...cue.Option) (string, error)
- type CueRuntime
- type CueSyntaxOptions
- type KeyVal
- type TestOpFunc
- type TestSuite
- func (TS *TestSuite) DoTestOp(name string, args cue.Value) (cue.Value, error)
- func (TS *TestSuite) RunCase(path string) (err error)
- func (TS *TestSuite) RunCases(paths []string) (err error)
- func (TS *TestSuite) RunGroup(cases, group string, V cue.Value) (err error)
- func (TS *TestSuite) RunTestCase(cases, group, test string, V cue.Value) (err error)
- func (TS *TestSuite) SetupCue() (err error)
- func (TS *TestSuite) SetupEntrypoints() (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_TESTDATA_DIRS = []string{"testdata"}
View Source
var ( DefaultSyntaxOpts = CueSyntaxOptions{ Attributes: true, Concrete: false, Definitions: true, Docs: true, Hidden: true, Optional: true, } )
Functions ¶
func CueErrorToString ¶ added in v0.6.1
func ExpandCueError ¶ added in v0.6.1
func FindModuleAbsPath ¶ added in v0.6.1
func PrintCueError ¶ added in v0.5.4
func PrintCueError(err error)
func RunDefFromArgs ¶
func RunEvalFromArgs ¶
func RunExportFromArgs ¶
func RunTrimFromArgs ¶
func RunVetFromArgs ¶
Types ¶
type CueRuntime ¶
type CueRuntime struct { Entrypoints []string Workspace string FS billy.Filesystem CueContext *cue.Context CueConfig *load.Config BuildInstances []*build.Instance CueErrors []error FieldOpts []cue.Option IncludeData bool CueInstance *cue.Instance CueValue cue.Value Value interface{} // contains filtered or unexported fields }
func CueRuntimeFromEntrypoints ¶ added in v0.5.4
func CueRuntimeFromEntrypoints(entrypoints []string) (crt *CueRuntime, err error)
CueRuntimeFromArgs builds up a CueRuntime
by processing the args passed in
func CueRuntimeFromEntrypointsAndFlags ¶ added in v0.5.4
func CueRuntimeFromEntrypointsAndFlags(entrypoints []string) (crt *CueRuntime, err error)
CueRuntimeFromArgsAndFlags builds up a CueRuntime
by processing the args passed in AND the current flag values
func (*CueRuntime) ConvertToValue ¶ added in v0.5.4
func (CRT *CueRuntime) ConvertToValue(in interface{}) (cue.Value, error)
func (*CueRuntime) Load ¶
func (CRT *CueRuntime) Load() (err error)
func (*CueRuntime) ParseCueExpr ¶ added in v0.5.4
func (CRT *CueRuntime) ParseCueExpr(expr string) (cue.Value, error)
func (*CueRuntime) PrintCueErrors ¶ added in v0.5.4
func (CR *CueRuntime) PrintCueErrors()
func (*CueRuntime) PrintValue ¶
func (CRT *CueRuntime) PrintValue() error
type CueSyntaxOptions ¶ added in v0.5.4
type CueSyntaxOptions struct { Attributes bool Concrete bool Definitions bool Docs bool Hidden bool Optional bool }
func (CueSyntaxOptions) MakeOpts ¶ added in v0.5.4
func (CSO CueSyntaxOptions) MakeOpts() []cue.Option
type KeyVal ¶ added in v0.5.7
func GetByAttrKeys ¶ added in v0.5.7
GetByAttrAndKeys extracts fields from a value by attribute and key names if all or any is empty, the condition check is skipped and all values will pass so to get all values with an attribute, with no concern for the contents, use:
GetByAttrAndKeys(val, "myattr", []string{}, []string{})
TODO, change this to return map[string]cue.Value
type TestOpFunc ¶ added in v0.5.4
type TestSuite ¶ added in v0.5.4
type TestSuite struct { suite.Suite Op TestOpFunc CRT *CueRuntime TestdataDirs []string Entrypoints []string }
func NewTestSuite ¶ added in v0.5.4
func NewTestSuite(testdirs []string, op TestOpFunc) *TestSuite
func (*TestSuite) RunTestCase ¶ added in v0.5.4
func (*TestSuite) SetupEntrypoints ¶ added in v0.5.4
Click to show internal directories.
Click to hide internal directories.