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 EnsureKeywordSafe(name string) string
- 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 PyName(name string) string
- type DocLanguageHelper
- func (d DocLanguageHelper) GenPropertyCaseMap(pkg *schema.Package, modName, tool string, prop *schema.Property, ...)
- func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(packageName, modName, typeName string, input bool) string
- func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(packageName, modName, typeName string, input bool) string
- func (d DocLanguageHelper) GetDocLinkForResourceType(packageName, modName, typeName string) string
- func (d DocLanguageHelper) GetLanguageTypeString(pkg *schema.Package, moduleName string, t schema.Type, input, optional bool) string
- func (d DocLanguageHelper) GetPropertyName(p *schema.Property) (string, error)
- func (d DocLanguageHelper) GetResourceFunctionResultName(resourceName string) string
Constants ¶
This section is empty.
Variables ¶
var Keywords = map[string]bool{ "False": true, "None": true, "True": true, "and": true, "as": true, "assert": true, "async": true, "await": true, "break": true, "class": true, "continue": true, "def": true, "del": true, "elif": true, "else": true, "except": true, "exec": true, "finally": true, "for": true, "from": true, "global": true, "if": true, "import": true, "in": true, "is": true, "lambda": true, "nonlocal": true, "not": true, "or": true, "pass": true, "print": true, "raise": true, "return": true, "try": true, "while": true, "with": true, "yield": true, }
Keywords is a map of reserved keywords used by Python 2 and 3. We use this to avoid generating unspeakable names in the resulting code. This map was sourced by merging the following reference material:
Functions ¶
func EnsureKeywordSafe ¶
EnsureKeywordSafe adds a trailing underscore if the generated name clashes with a Python 2 or 3 keyword, per PEP 8: https://www.python.org/dev/peps/pep-0008/?#function-and-method-arguments
func GeneratePackage ¶
func GenerateProgram ¶ added in v1.14.1
Types ¶
type DocLanguageHelper ¶
type DocLanguageHelper struct{}
DocLanguageHelper is the Python-specific implementation of the DocLanguageHelper.
func (DocLanguageHelper) GenPropertyCaseMap ¶
func (d DocLanguageHelper) GenPropertyCaseMap(pkg *schema.Package, modName, tool string, prop *schema.Property, snakeCaseToCamelCase, camelCaseToSnakeCase map[string]string)
GenPropertyCaseMap generates the case maps for a property.
func (DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType ¶
func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(packageName, modName, typeName string, input bool) string
GetDocLinkForFunctionInputOrOutputType is not implemented at this time for Python.
func (DocLanguageHelper) GetDocLinkForResourceInputOrOutputType ¶
func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(packageName, modName, typeName string, input bool) string
GetDocLinkForResourceInputOrOutputType is not implemented at this time for Python.
func (DocLanguageHelper) GetDocLinkForResourceType ¶
func (d DocLanguageHelper) GetDocLinkForResourceType(packageName, modName, typeName string) string
GetDocLinkForResourceType is not implemented at this time for Python.
func (DocLanguageHelper) GetLanguageTypeString ¶
func (d DocLanguageHelper) GetLanguageTypeString(pkg *schema.Package, moduleName string, t schema.Type, input, optional bool) string
GetLanguageTypeString returns the Python-specific type given a Pulumi schema type.
func (DocLanguageHelper) GetPropertyName ¶
func (d DocLanguageHelper) GetPropertyName(p *schema.Property) (string, error)
GetPropertyName is not implemented for Python because property names in Python must use property case maps, which need to be generated at each provider's package-level.
func (DocLanguageHelper) GetResourceFunctionResultName ¶
func (d DocLanguageHelper) GetResourceFunctionResultName(resourceName string) string
GetResourceFunctionResultName is not implemented for Python and returns an empty string.