0.1.1 • Published 1 year ago
@kubenode/crdgen v0.1.1
@kubenode/crdgen
Utilities for creating Kubernetes CRDs from TypeScript definitions.
Classes
Functions
Typedefs
Model
Class representing a single custom resource model.
Kind: global class
new Model(program, node, config)
Construct a model.
| Param | Type | Description |
|---|---|---|
| program | ts.Program | TypeScript API Program. |
| node | ts.TypeAliasDeclaration | TypeScript API TypeAliasDeclaration node. |
| config | ModelCommentConfig | Model configuration extracted from JSDoc comments. |
model.toCRD() ⇒ ModelCRD
Converts the Model to a CRD object that can be stringified to YAML.
Kind: instance method of Model Returns: ModelCRD - An object representation of the Model as a Kubernetes CRD.
generateModelsFromFiles(filenames) ⇒ Map.<string, Model>
Generates models defined in a collection of files.
Kind: global function
| Param | Type | Description |
|---|---|---|
| filenames | Array.<string> | The files to extract models from. |
getModelConfigFromComments(jsDocs) ⇒ ModelCommentConfig
Extracts a model configuration from JSDoc comments.
Kind: global function
| Param | Type |
|---|---|
| jsDocs | Array.<any> |
ModelCommentConfig : object
Kind: global typedef Properties
| Name | Type |
|---|---|
| apiVersion | string |
| description | string |
| kind | string |
| isNamespaced | boolean |
| plural | string |
| singular | string |
ModelCRD : object
Kind: global typedef Properties
| Name | Type |
|---|---|
| apiVersion | string |
| kind | string |
| metadata | object |
| spec | object |