Documentation ¶
Overview ¶
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
nolint: lll, goconst
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
nolint: lll, goconst
Index ¶
- Variables
- func GeneratePackage(tool string, pkg *schema.Package, extraFiles map[string][]byte) (map[string][]byte, error)
- func GenerateProgram(program *hcl2.Program) (map[string][]byte, hcl.Diagnostics, error)
- func LanguageResources(pkg *schema.Package) (map[string]LanguageResource, error)
- type DocLanguageHelper
- func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(pkg *schema.Package, modName, typeName string, input bool) string
- func (d DocLanguageHelper) GetDocLinkForPulumiType(pkg *schema.Package, typeName string) string
- func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(pkg *schema.Package, modName, typeName string, input bool) string
- func (d DocLanguageHelper) GetDocLinkForResourceType(pkg *schema.Package, modName, typeName string) string
- func (d DocLanguageHelper) GetEnumName(e *schema.Enum, typeName string) (string, error)
- func (d DocLanguageHelper) GetFunctionName(modName string, f *schema.Function) string
- func (d DocLanguageHelper) GetLanguageTypeString(pkg *schema.Package, moduleName string, t schema.Type, input, optional bool) string
- func (d DocLanguageHelper) GetModuleDocLink(pkg *schema.Package, modName string) (string, string)
- func (d DocLanguageHelper) GetPropertyName(p *schema.Property) (string, error)
- func (d DocLanguageHelper) GetResourceFunctionResultName(modName string, f *schema.Function) string
- type LanguageProperty
- type LanguageResource
- type NodeObjectInfo
- type NodePackageInfo
Constants ¶
This section is empty.
Variables ¶
var Importer schema.Language = importer(0)
Importer implements schema.Language for NodeJS.
Functions ¶
func GeneratePackage ¶
func GenerateProgram ¶
func LanguageResources ¶ added in v2.4.0
func LanguageResources(pkg *schema.Package) (map[string]LanguageResource, error)
LanguageResources returns a map of resources that can be used by downstream codegen. The map key is the resource schema token.
Types ¶
type DocLanguageHelper ¶
type DocLanguageHelper struct{}
DocLanguageHelper is the NodeJS-specific implementation of the DocLanguageHelper.
func (DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType ¶
func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(pkg *schema.Package, modName, typeName string, input bool) string
GetDocLinkForFunctionInputOrOutputType returns the doc link for an input or output type of a Function.
func (DocLanguageHelper) GetDocLinkForPulumiType ¶
func (d DocLanguageHelper) GetDocLinkForPulumiType(pkg *schema.Package, typeName string) string
GetDocLinkForPulumiType returns the NodeJS API doc link for a Pulumi type.
func (DocLanguageHelper) GetDocLinkForResourceInputOrOutputType ¶
func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(pkg *schema.Package, modName, typeName string, input bool) string
GetDocLinkForResourceInputOrOutputType returns the doc link for an input or output type of a Resource.
func (DocLanguageHelper) GetDocLinkForResourceType ¶
func (d DocLanguageHelper) GetDocLinkForResourceType(pkg *schema.Package, modName, typeName string) string
GetDocLinkForResourceType returns the NodeJS API doc for a type belonging to a resource provider.
func (DocLanguageHelper) GetEnumName ¶ added in v2.16.0
GetEnumName returns the enum name specific to NodeJS.
func (DocLanguageHelper) GetFunctionName ¶ added in v2.1.0
func (d DocLanguageHelper) GetFunctionName(modName string, f *schema.Function) string
func (DocLanguageHelper) GetLanguageTypeString ¶
func (d DocLanguageHelper) GetLanguageTypeString(pkg *schema.Package, moduleName string, t schema.Type, input, optional bool) string
GetLanguageTypeString returns the language-specific type given a Pulumi schema type.
func (DocLanguageHelper) GetModuleDocLink ¶ added in v2.2.0
GetModuleDocLink returns the display name and the link for a module.
func (DocLanguageHelper) GetPropertyName ¶
func (d DocLanguageHelper) GetPropertyName(p *schema.Property) (string, error)
GetPropertyName returns the property name specific to NodeJS.
func (DocLanguageHelper) GetResourceFunctionResultName ¶
func (d DocLanguageHelper) GetResourceFunctionResultName(modName string, f *schema.Function) string
GetResourceFunctionResultName returns the name of the result type when a function is used to lookup an existing resource.
type LanguageProperty ¶ added in v2.4.0
type LanguageProperty struct { ConstValue string // If set, the constant value of the property (e.g., "flowcontrol.apiserver.k8s.io/v1alpha1") Name string // The name of the property (e.g., "FlowSchemaSpec") Package string // The package path containing the property definition (e.g., "outputs.flowcontrol.v1alpha1") }
LanguageProperty holds information about a resource property to be used by downstream codegen.
type LanguageResource ¶ added in v2.4.0
type LanguageResource struct { *schema.Resource Name string // The resource name (e.g., "FlowSchema") Package string // The name of the package containing the resource definition (e.g., "flowcontrol.v1alpha1") Properties []LanguageProperty // Properties of the resource }
LanguageResource holds information about a resource to be used by downstream codegen.
type NodeObjectInfo ¶ added in v2.4.0
type NodeObjectInfo struct { // List of properties that are required on the input side of a type. RequiredInputs []string `json:"requiredInputs"` // List of properties that are required on the output side of a type. RequiredOutputs []string `json:"requiredOutputs"` }
NodeObjectInfo contains NodeJS-specific information for an object.
type NodePackageInfo ¶
type NodePackageInfo struct { // Custom name for the NPM package. PackageName string `json:"packageName,omitempty"` // Description for the NPM package. PackageDescription string `json:"packageDescription,omitempty"` // Readme contains the text for the package's README.md files. Readme string `json:"readme,omitempty"` // NPM dependencies to add to package.json. Dependencies map[string]string `json:"dependencies,omitempty"` // NPM dev-dependencies to add to package.json. DevDependencies map[string]string `json:"devDependencies,omitempty"` // NPM peer-dependencies to add to package.json. PeerDependencies map[string]string `json:"peerDependencies,omitempty"` // NPM resolutions to add to package.json Resolutions map[string]string `json:"resolutions,omitempty"` // A specific version of TypeScript to include in package.json. TypeScriptVersion string `json:"typescriptVersion,omitempty"` // A map containing overrides for module names to package names. ModuleToPackage map[string]string `json:"moduleToPackage,omitempty"` // Toggle compatibility mode for a specified target. Compatibility string `json:"compatibility,omitempty"` // Disable support for unions in output types. DisableUnionOutputTypes bool `json:"disableUnionOutputTypes,omitempty"` // An indicator for whether the package contains enums. ContainsEnums bool `json:"containsEnums,omitempty"` }
NodePackageInfo contains NodeJS-specific information for a package.