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() (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 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 ¶
func ExpandCueError ¶
func FindModuleAbsPath ¶
func PrintCueError ¶
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 CueInstance *cue.Instance CueValue cue.Value Value interface{} }
func CueRuntimeFromEntrypoints ¶
func CueRuntimeFromEntrypoints(entrypoints []string) (crt *CueRuntime, err error)
CueRuntimeFromArgs builds up a CueRuntime
by processing the args passed in
func CueRuntimeFromEntrypointsAndFlags ¶
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 ¶
func (CRT *CueRuntime) ConvertToValue(in interface{}) (cue.Value, error)
func (*CueRuntime) Load ¶
func (CRT *CueRuntime) Load() (err error)
func (*CueRuntime) ParseCueExpr ¶
func (CRT *CueRuntime) ParseCueExpr(expr string) (cue.Value, error)
func (*CueRuntime) PrintCueErrors ¶
func (CR *CueRuntime) PrintCueErrors()
func (*CueRuntime) PrintValue ¶
func (CRT *CueRuntime) PrintValue() error
type CueSyntaxOptions ¶
type CueSyntaxOptions struct { Attributes bool Concrete bool Definitions bool Docs bool Hidden bool Optional bool }
func (CueSyntaxOptions) MakeOpts ¶
func (CSO CueSyntaxOptions) MakeOpts() []cue.Option
type KeyVal ¶
func GetByAttrKeys ¶
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 TestSuite ¶
type TestSuite struct { suite.Suite Op TestOpFunc CRT *CueRuntime TestdataDirs []string Entrypoints []string }
func NewTestSuite ¶
func NewTestSuite(testdirs []string, op TestOpFunc) *TestSuite
func (*TestSuite) RunTestCase ¶
func (*TestSuite) SetupEntrypoints ¶
Click to show internal directories.
Click to hide internal directories.