generate

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MPL-2.0 Imports: 38 Imported by: 1

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 added in v3.4.0

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

func Generate

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

func (GenerationResult) Blocks added in v3.4.0

func (r GenerationResult) Blocks() int

type GenerationSuccess added in v3.4.0

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 added in v3.5.0

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 added in v3.5.0

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

func (NonCriticalGenerationFailure) NonCriticalError added in v3.5.0

func (f NonCriticalGenerationFailure) NonCriticalError()

type OutputFormat

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

type ResourceError added in v3.4.0

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

ResourceError is an error that occurred while generating a resource.

func (ResourceError) Error added in v3.4.0

func (e ResourceError) Error() string

func (ResourceError) NonCriticalError added in v3.5.0

func (ResourceError) NonCriticalError()

type TerraformInstallConfig added in v3.4.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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