cuekind

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultManifestSelector = "manifest"

Variables

This section is empty.

Functions

func AppGenerator added in v0.23.0

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

func BackendPluginGenerator

func BackendPluginGenerator(projectRepo, generatedAPIPath string, 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 ManifestGenerator added in v0.20.0

func ManifestGenerator(encoder jennies.ManifestOutputEncoder, extension string) *codejen.JennyList[codegen.AppManifest]

func ManifestGoGenerator added in v0.20.0

func ManifestGoGenerator(pkg string) *codejen.JennyList[codegen.AppManifest]

func OperatorGenerator

func OperatorGenerator(projectRepo, codegenPath string, 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, groupKinds bool) *codejen.JennyList[codegen.Kind]

func ResourceGenerator

func ResourceGenerator(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 `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 TypeScriptResourceGenerator added in v0.15.0

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

TypeScriptResourceGenerator returns a Generator which generates TypeScript resource code.

Types

type Parser

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

func NewParser

func NewParser() (*Parser, error)

func (*Parser) KindParser added in v0.27.0

func (p *Parser) KindParser(useManifest bool) codegen.Parser[codegen.Kind]

KindParser returns a Parser that returns a list of codegen.Kind. If useManifest is true, it will load kinds from a manifest provided by the selector(s) in Parse (or DefaultManifestSelector if no selectors are present), rather than loading the selector(s) as kinds.

func (*Parser) ManifestParser added in v0.27.0

func (p *Parser) ManifestParser() codegen.Parser[codegen.AppManifest]

func (*Parser) ParseKinds added in v0.27.0

func (p *Parser) ParseKinds(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.

func (*Parser) ParseManifest added in v0.27.0

func (p *Parser) ParseManifest(files fs.FS, manifestSelector string) (codegen.AppManifest, error)

ParseManifest parses ManifestSelector (or the root object if no selector is provided) as a CUE app manifest, returning the parsed codegen.AppManifest object or an error.

Jump to

Keyboard shortcuts

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