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: goconst
Index ¶
- Constants
- Variables
- func GenerateSchema(info tfbridge.ProviderInfo, sink diag.Sink) (pschema.PackageSpec, error)
- func LoadGoMod() (*modfile.File, error)
- func Main(pkg string, version string, prov tfbridge.ProviderInfo)
- type CoverageTracker
- type DocKind
- type DocumentationPage
- type Example
- type GenerateOptions
- type Generator
- type GeneratorOptions
- type Language
- type LanguageConversionResult
Constants ¶
const ( Success = 0 Warning = 1 Failure = 2 Fatal = 3 )
Conversion outcome severity values
Variables ¶
Functions ¶
func GenerateSchema ¶
func GenerateSchema(info tfbridge.ProviderInfo, sink diag.Sink) (pschema.PackageSpec, error)
Types ¶
type CoverageTracker ¶ added in v3.6.0
type CoverageTracker struct { ProviderName string // Name of the provider ProviderVersion string // Version of the provider EncounteredPages map[string]*DocumentationPage // Map linking page IDs to their data // contains filtered or unexported fields }
Main overarching structure for storing coverage data on how many examples were processed, how many failed, and for what reason. At different stages, the code translator notifies the tracker of what is going on. Notifications are treated as an ordered sequence of events.
NOTIFICATION INTERFACE:
foundExample(pageName, hcl)
languageConversionSuccess(targetLanguage)
languageConversionWarning(targetLanguage, warningDiagnostics)
languageConversionFailure(targetLanguage, failureDiagnostics)
languageConversionPanic(targetLanguage, panicInfo)
type DocKind ¶
type DocKind string
DocKind indicates what kind of entity's documentation is being requested.
type DocumentationPage ¶ added in v3.12.0
type DocumentationPage struct { Name string // The unique ID of this documentation page Examples []Example // This page's examples, stored in the order they were found }
A structure encompassing a single page, which contains one or more examples. This closely resembles the web pages seen in Pulumi/Terraform documentation.
type Example ¶ added in v3.12.0
type Example struct { OriginalHCL string // Original HCL code that the example was found with ConversionResults map[string]*LanguageConversionResult // Mapping language names to their conversion results }
Contains information about a single example, consisting of a block of HCL and one or more language conversion results.
type GenerateOptions ¶
type GenerateOptions struct {
ModuleFormat string
}
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(opts GeneratorOptions) (*Generator, error)
NewGenerator returns a code-generator for the given language runtime and package info.
type GeneratorOptions ¶
type GeneratorOptions struct { Package string Version string Language Language ProviderInfo tfbridge.ProviderInfo Root afero.Fs ProviderInfoSource il.ProviderInfoSource PluginHost plugin.Host TerraformVersion string Sink diag.Sink Debug bool SkipDocs bool SkipExamples bool CoverageTracker *CoverageTracker }
type LanguageConversionResult ¶ added in v3.6.0
type LanguageConversionResult struct { FailureSeverity int // This conversion's outcome: [Success, Warning, Failure, Fatal] FailureInfo string // Additional in-depth information // How many times this example has been converted to this language. // It is expected that this will be equal to 1. TranslationCount int }
Individual language information concerning how successfully an example was converted to Pulumi