Documentation ¶
Overview ¶
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Index ¶
- Variables
- func AnnotateComponentInputs(component *pcl.Component)
- func GeneratePackage(tool string, pkg *schema.Package, extraFiles map[string][]byte, ...) (map[string][]byte, error)
- func GenerateProgram(program *pcl.Program) (map[string][]byte, hcl.Diagnostics, error)
- func GenerateProgramWithOptions(program *pcl.Program, options GenerateProgramOptions) (map[string][]byte, hcl.Diagnostics, error)
- func GenerateProject(directory string, project workspace.Project, program *pcl.Program, ...) error
- func LanguageResources(tool string, pkg *schema.Package) (map[string]LanguageResource, error)
- func LowerCamelCase(s string) string
- func Title(s string) string
- type CSharpPackageInfo
- type CSharpPropertyInfo
- type CSharpResourceInfo
- type DocLanguageHelper
- func (d DocLanguageHelper) GetDocLinkForCodeinfraType(pkg *schema.Package, typeName string) string
- func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(pkg *schema.Package, moduleName, typeName string, input bool) string
- func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(pkg *schema.Package, moduleName, typeName string, input bool) string
- func (d DocLanguageHelper) GetDocLinkForResourceType(pkg *schema.Package, _, 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 bool) string
- func (d DocLanguageHelper) GetMethodName(m *schema.Method) string
- func (d DocLanguageHelper) GetMethodResultName(pkg *schema.Package, modName string, r *schema.Resource, m *schema.Method) 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 GenerateProgramOptions
- type LanguageResource
- type ObjectTypeFromConfigMetadata
Constants ¶
This section is empty.
Variables ¶
var Importer schema.Language = importer(0)
Importer implements schema.Language for .NET.
Functions ¶
func AnnotateComponentInputs ¶
func GeneratePackage ¶
func GenerateProgram ¶
func GenerateProject ¶
func LanguageResources ¶
LanguageResources returns a map of resources that can be used by downstream codegen. The map key is the resource schema token.
func LowerCamelCase ¶
LowerCamelCase sets the first character to lowercase LowerCamelCase("LowerCamelCase") -> "lowerCamelCase"
Types ¶
type CSharpPackageInfo ¶
type CSharpPackageInfo struct { PackageReferences map[string]string `json:"packageReferences,omitempty"` Namespaces map[string]string `json:"namespaces,omitempty"` Compatibility string `json:"compatibility,omitempty"` DictionaryConstructors bool `json:"dictionaryConstructors,omitempty"` ProjectReferences []string `json:"projectReferences,omitempty"` // Determines whether to make single-return-value methods return an output object or the single value. LiftSingleValueMethodReturns bool `json:"liftSingleValueMethodReturns,omitempty"` // The root namespace used for the package. This defaults to `Codeinfra`. RootNamespace string `json:"rootNamespace,omitempty"` // Allow the Pkg.Version field to filter down to emitted code. RespectSchemaVersion bool `json:"respectSchemaVersion,omitempty"` }
CSharpPackageInfo represents the C# language-specific info for a package.
func (*CSharpPackageInfo) GetRootNamespace ¶
func (info *CSharpPackageInfo) GetRootNamespace() string
Returns the root namespace, or "Codeinfra" if not provided.
type CSharpPropertyInfo ¶
type CSharpPropertyInfo struct {
Name string `json:"name,omitempty"`
}
CSharpPropertyInfo represents the C# language-specific info for a property.
type CSharpResourceInfo ¶
type CSharpResourceInfo struct {
Name string `json:"name,omitempty"`
}
CSharpResourceInfo represents the C# language-specific info for a resource.
type DocLanguageHelper ¶
type DocLanguageHelper struct { // Namespaces is a map of Codeinfra schema module names to their // C# equivalent names, to be used when creating fully-qualified // property type strings. Namespaces map[string]string }
DocLanguageHelper is the DotNet-specific implementation of the DocLanguageHelper.
func (DocLanguageHelper) GetDocLinkForCodeinfraType ¶
func (d DocLanguageHelper) GetDocLinkForCodeinfraType(pkg *schema.Package, typeName string) string
GetDocLinkForCodeinfraType returns the .Net API doc link for a Codeinfra type.
func (DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType ¶
func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(pkg *schema.Package, moduleName, typeName string, input bool) string
GetDocLinkForFunctionInputOrOutputType returns the doc link for an input or output type of a Function.
func (DocLanguageHelper) GetDocLinkForResourceInputOrOutputType ¶
func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(pkg *schema.Package, moduleName, 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, _, typeName string) string
GetDocLinkForResourceType returns the .NET API doc URL for a type belonging to a resource provider.
func (DocLanguageHelper) GetEnumName ¶
GetEnumName returns the enum name specific to C#.
func (DocLanguageHelper) GetFunctionName ¶
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 bool) string
GetLanguageTypeString returns the DotNet-specific type given a Codeinfra schema type.
func (DocLanguageHelper) GetMethodName ¶
func (d DocLanguageHelper) GetMethodName(m *schema.Method) string
func (DocLanguageHelper) GetMethodResultName ¶
func (DocLanguageHelper) GetModuleDocLink ¶
GetModuleDocLink returns the display name and the link for a module.
func (DocLanguageHelper) GetPropertyName ¶
func (d DocLanguageHelper) GetPropertyName(p *schema.Property) (string, error)
GetPropertyName uses the property's csharp-specific language info, if available, to generate the property name. Otherwise, returns the PascalCase as the default.
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 GenerateProgramOptions ¶
type GenerateProgramOptions struct {
// contains filtered or unexported fields
}
type LanguageResource ¶
type LanguageResource struct { *schema.Resource Name string // The resource name (e.g. Deployment) Package string // The package name (e.g. Apps.V1) }
LanguageResource is derived from the schema and can be used by downstream codegen.