Documentation ¶
Index ¶
- Constants
- func AppGenerator(projectRepo, codegenPath string, groupKinds bool) *codejen.JennyList[codegen.Kind]
- func BackendPluginGenerator(projectRepo, generatedAPIPath string, groupKinds bool) *codejen.JennyList[codegen.Kind]
- func CRDGenerator(outputEncoder jennies.CRDOutputEncoder, outputExtension string) *codejen.JennyList[codegen.Kind]
- func ManifestGenerator(encoder jennies.ManifestOutputEncoder, extension string) *codejen.JennyList[codegen.AppManifest]
- func ManifestGoGenerator(pkg string) *codejen.JennyList[codegen.AppManifest]
- func OperatorGenerator(projectRepo, codegenPath string, groupKinds bool) *codejen.JennyList[codegen.Kind]
- func PostResourceGenerationGenerator(projectRepo, goGenPath string, groupKinds bool) *codejen.JennyList[codegen.Kind]
- func ResourceGenerator(groupKinds bool) *codejen.JennyList[codegen.Kind]
- func ToOverlay(prefix string, vfs fs.FS, overlay map[string]load.Source) error
- func TypeScriptResourceGenerator() *codejen.JennyList[codegen.Kind]
- type Parser
- func (p *Parser) KindParser(useManifest bool) codegen.Parser[codegen.Kind]
- func (p *Parser) ManifestParser() codegen.Parser[codegen.AppManifest]
- func (p *Parser) ParseKinds(files fs.FS, selectors ...string) ([]codegen.Kind, error)
- func (p *Parser) ParseManifest(files fs.FS, manifestSelector string) (codegen.AppManifest, error)
Constants ¶
const DefaultManifestSelector = "manifest"
Variables ¶
This section is empty.
Functions ¶
func AppGenerator ¶ added in v0.23.0
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 ResourceGenerator ¶
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.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) KindParser ¶ added in v0.27.0
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
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
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.