cuetils

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2020 License: BSD-3-Clause Imports: 19 Imported by: 7

Documentation

Index

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 CueSyntax added in v0.5.4

func CueSyntax(val cue.Value, opts []cue.Option) ast.Node

func PrintCueError added in v0.5.4

func PrintCueError(err error)

func PrintCueValue added in v0.5.4

func PrintCueValue(val cue.Value) (string, error)

func RunDefFromArgs

func RunDefFromArgs(args []string) error

func RunEvalFromArgs

func RunEvalFromArgs(args []string) error

func RunExportFromArgs

func RunExportFromArgs(args []string) error

func RunFmtFromArgs

func RunFmtFromArgs(args []string) error

func RunImportFromArgs

func RunImportFromArgs(args []string) error

func RunTrimFromArgs

func RunTrimFromArgs(args []string) error

func RunVetFromArgs

func RunVetFromArgs(args []string) error

func ValueToSyntaxString added in v0.5.4

func ValueToSyntaxString(val cue.Value) (string, error)

Types

type CueRuntime

type CueRuntime struct {
	Entrypoints []string
	Workspace   string
	FS          billy.Filesystem

	CueRuntime     *cue.Runtime
	CueConfig      *load.Config
	BuildInstances []*build.Instance
	CueErrors      []error
	FieldOpts      []cue.Option

	CueInstance *cue.Instance
	CueValue    cue.Value
	Value       interface{}
}

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 TestOpFunc added in v0.5.4

type TestOpFunc func(name string, args cue.Value) (cue.Value, error)

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) DoTestOp added in v0.5.4

func (TS *TestSuite) DoTestOp(name string, args cue.Value) (cue.Value, error)

func (*TestSuite) RunCase added in v0.5.4

func (TS *TestSuite) RunCase(path string) (err error)

func (*TestSuite) RunCases added in v0.5.4

func (TS *TestSuite) RunCases(paths []string) (err error)

func (*TestSuite) RunGroup added in v0.5.4

func (TS *TestSuite) RunGroup(cases, group string, V cue.Value) (err error)

func (*TestSuite) RunTestCase added in v0.5.4

func (TS *TestSuite) RunTestCase(cases, group, test string, V cue.Value) (err error)

func (*TestSuite) SetupCue added in v0.5.4

func (TS *TestSuite) SetupCue() (err error)

func (*TestSuite) SetupEntrypoints added in v0.5.4

func (TS *TestSuite) SetupEntrypoints() (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL