generate

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FactoryCmd = &cobra.Command{
		Use:   "factory",
		Short: "Scaffold a new factory",
		Args:  cobra.NoArgs,
		Long: `Scaffold a new factory directory.

The generated directory contains a factory.ub source file with empty
placeholder blocks the author fills in. A stack file is operator supplied
per stack; use the compiled factory's schema template command to create
one.

Examples:
  unobin generate factory -o ./my-factory`,

		RunE: func(cmd *cobra.Command, args []string) error {
			return runFactory(cmd, factoryCfg)
		},
	}
)
View Source
var (
	GolibraryCmd = &cobra.Command{
		Use:   "golibrary",
		Short: "Generate a Go library skeleton from a TF provider schema",
		Args:  cobra.NoArgs,
		Long: "Generate a Go library from a Terraform provider schema.\n\n" +
			"The generated Go library contains typed structs with ub tags and\n" +
			"CRUD method stubs for every resource in the provider.\n\n" +
			"Examples:\n" +
			"  unobin generate golibrary --from tf --provider random " +
			"--go-module-path example.com/libraries/random\n" +
			"  unobin generate golibrary --from tf --provider aws -o ./aws-library " +
			"--go-module-path example.com/libraries/aws",

		RunE: func(cmd *cobra.Command, args []string) error {
			return runGenerate(cmd, golibraryCfg)
		},
	}
)
View Source
var (
	UblibraryCmd = &cobra.Command{
		Use:   "ublibrary",
		Short: "Scaffold a new UB library",
		Args:  cobra.NoArgs,
		Long: `Scaffold a new UB library directory.

The generated directory contains one starter resource composite export
file named <type>.ub. The directory listing is the project, so there is
no separate project file. Blocks are empty for the author to fill in.

Examples:
  unobin generate ublibrary -o ./greeter
  unobin generate ublibrary -o ./greeter --type greeting`,

		RunE: func(cmd *cobra.Command, args []string) error {
			return runUblibrary(cmd, ublibraryCfg)
		},
	}
)

Functions

func SetGoLibraryAdapterForTest added in v0.11.0

func SetGoLibraryAdapterForTest(
	adapter func(provider, version string) gogen.SchemaAdapter,
) func()

SetGoLibraryAdapterForTest replaces schema adapter construction and returns a restore function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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