cuekind

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackendPluginGenerator

func BackendPluginGenerator(projectRepo, generatedAPIPath string, versioned bool, groupKinds bool) *codejen.JennyList[codegen.Kind]

BackendPluginGenerator returns a Generator which will produce boilerplate backend plugin code

func CRDGenerator

func CRDGenerator(outputEncoder jennies.CRDOutputEncoder, outputExtension string) *codejen.JennyList[codegen.Kind]

CRDGenerator returns a Generator which will create a CRD file

func ModelsGenerator

func ModelsGenerator(versioned bool) *codejen.JennyList[codegen.Kind]

ModelsGenerator returns a Generator which will produce Go and CUE files for API contract models. The `versioned` parameter governs whether to generate all versions where codegen.backend == true, or just generate code for the current version. If `versioned` is true, the paths to the generated files will include the version, and the package name will be the version, rather than the kind.

func OperatorGenerator

func OperatorGenerator(projectRepo, codegenPath string, versioned bool, groupKinds bool) *codejen.JennyList[codegen.Kind]

OperatorGenerator returns a Generator which will build out watcher boilerplate for each resource, and a main func to run an operator for the watchers.

func PostResourceGenerationGenerator added in v0.16.0

func PostResourceGenerationGenerator(projectRepo, goGenPath string, versioned bool, groupKinds bool) *codejen.JennyList[codegen.Kind]

func ResourceGenerator

func ResourceGenerator(versioned bool, groupKinds bool) *codejen.JennyList[codegen.Kind]

ResourceGenerator returns a collection of jennies which generate backend resource code from kinds. The `versioned` parameter governs whether to generate all versions where codegen.backend == true, or just generate code for the current version. If `versioned` is true, the paths to the generated files will include the version, and the package name will be the version, rather than the kind. If `groupKinds` is true, kinds within the same group will exist in the same package. When combined with `versioned`, each version package will contain all kinds in the group which have a schema for that version.

func ToOverlay

func ToOverlay(prefix string, vfs fs.FS, overlay map[string]load.Source) error

func TypeScriptModelsGenerator

func TypeScriptModelsGenerator(versioned bool) *codejen.JennyList[codegen.Kind]

TypeScriptModelsGenerator returns a Generator which generates TypeScript model code. The `versioned` parameter governs whether to generate all versions where codegen.frontend == true, or just generate code for the current version. If `versioned` is true, the paths to the generated files will include the version.

func TypeScriptResourceGenerator added in v0.15.0

func TypeScriptResourceGenerator(versioned bool) *codejen.JennyList[codegen.Kind]

TypeScriptResourceGenerator returns a Generator which generates TypeScript resource code. The `versioned` parameter governs whether to generate all versions where codegen.frontend == true, or just generate code for the current version. If `versioned` is true, the paths to the generated files will include the version.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser() (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse(files fs.FS, selectors ...string) ([]codegen.Kind, error)

Parse parses all CUE files in `files`, and reads all top-level selectors (or only `selectors` if provided) as kinds as defined by [def.cue]. It then returns a list of kinds parsed.

Jump to

Keyboard shortcuts

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