generate

package
v4.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License: MPL-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CloudConfig

type CloudConfig struct {
	AccessPolicyToken         string
	Org                       string
	CreateStackServiceAccount bool
	StackServiceAccountName   string
}

type Config

type Config struct {
	// IncludeResources is a list of patterns to filter resources by.
	// If a resource name matches any of the patterns, it will be included in the output.
	// Patterns are in the form of `resourceType.resourceName` and support * as a wildcard.
	IncludeResources []string
	// OutputDir is the directory to write the generated files to.
	OutputDir string
	// Clobber will overwrite existing files in the output directory.
	Clobber           bool
	OutputCredentials bool
	Format            OutputFormat
	ProviderVersion   string
	Grafana           *GrafanaConfig
	Cloud             *CloudConfig

	TerraformInstallConfig TerraformInstallConfig
	Terraform              *tfexec.Terraform
}

type GenerationResult

type GenerationResult struct {
	Success []GenerationSuccess
	Errors  []error
}

func Generate

func Generate(ctx context.Context, cfg *Config) GenerationResult

func (GenerationResult) Blocks

func (r GenerationResult) Blocks() int

type GenerationSuccess

type GenerationSuccess struct {
	Resource *common.Resource
	Blocks   int
}

type GrafanaConfig

type GrafanaConfig struct {
	URL                 string
	Auth                string
	IsGrafanaCloudStack bool
	SMURL               string
	SMAccessToken       string
	OnCallURL           string
	OnCallAccessToken   string
}

type NonCriticalError

type NonCriticalError interface {
	NonCriticalError()
}

NonCriticalError is an error that is not critical to the generation process. It can be handled differently by the caller.

type NonCriticalGenerationFailure

type NonCriticalGenerationFailure struct {
	// contains filtered or unexported fields
}

func (NonCriticalGenerationFailure) NonCriticalError

func (f NonCriticalGenerationFailure) NonCriticalError()

type OutputFormat

type OutputFormat string
const (
	OutputFormatJSON       OutputFormat = "json"
	OutputFormatHCL        OutputFormat = "hcl"
	OutputFormatCrossplane OutputFormat = "crossplane"
)

type ResourceError

type ResourceError struct {
	Resource *common.Resource
	Err      error
}

ResourceError is an error that occurred while generating a resource.

func (ResourceError) Error

func (e ResourceError) Error() string

func (ResourceError) NonCriticalError

func (ResourceError) NonCriticalError()

type TerraformInstallConfig

type TerraformInstallConfig struct {
	InstallDir string
	Version    *version.Version
	PluginDir  string
}

Directories

Path Synopsis
genreferences command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL