Documentation ¶
Index ¶
Constants ¶
View Source
const (
ExternalDiffEnvVar = "XP_FUNCTION_CUE_DIFF"
)
Variables ¶
View Source
var TestOutput io.Writer = os.Stderr
Functions ¶
func ExtractSchema ¶
ExtractSchema extracts an openAPI schema from a CRD/ XRD-like object and returns the equivalent cue types.
func GenerateOpenAPISchema ¶
GenerateOpenAPISchema generates an openapi schema using the contents of the supplied directory and returns it prefixing it with a package declaration for the supplied package.
func PackageScript ¶
func PackageScript(dir string, opts PackageScriptOpts) (_ []byte, finalErr error)
PackageScript generates self-contained definitions from the supplied directory and returns cue code for an object with a _script property that contains the code as a string. The returned object has a package declaration for the package supplied.
Types ¶
type OutputFormat ¶
type OutputFormat string
const ( FormatRaw OutputFormat = "raw" FormatCue OutputFormat = "cue" )
type PackageScriptOpts ¶
type PackageScriptOpts struct { Format OutputFormat // output format OutputPackage string // package to declare for cue output VarName string // variable name to use for cue output, default _script }
type TestConfig ¶
Click to show internal directories.
Click to hide internal directories.