provider

package
v0.0.0-...-b4c0e7c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PROVIDER_MAINGO_PATH = "provider/cmd/provider/main.go.tpl"

	PROVIDER_INDEX_PATH           = "provider/generated/index.go.tpl"
	PROVIDERCONFIG_INIT_PATH      = "provider/generated/index_provider.go.tpl"
	RESOURCE_IMPLEMENTATIONS_PATH = "provider/generated/index_resources.go.tpl"

	PROVIDERCONFIG_DOC_PATH   = "provider/generated/provider/v1alpha1/doc.go.tpl"
	PROVIDERCONFIG_TYPES_PATH = "provider/generated/provider/v1alpha1/types.go.tpl"
	PROVIDERCONFIG_INDEX_PATH = "provider/generated/provider/v1alpha1/index.go.tpl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrapper

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

func (*Bootstrapper) Bootstrap

func (bs *Bootstrapper) Bootstrap() error

func (*Bootstrapper) WriteIndexGo

func (bs *Bootstrapper) WriteIndexGo() error

func (*Bootstrapper) WriteMainGo

func (bs *Bootstrapper) WriteMainGo() error

func (*Bootstrapper) WriteProviderDoc

func (bs *Bootstrapper) WriteProviderDoc() error

func (*Bootstrapper) WriteProviderIndex

func (bs *Bootstrapper) WriteProviderIndex() error

func (*Bootstrapper) WriteProviderInitGo

func (bs *Bootstrapper) WriteProviderInitGo() error

func (*Bootstrapper) WriteProviderTypes

func (bs *Bootstrapper) WriteProviderTypes() error

type Config

type Config struct {
	ProviderVersion       string   `json:"provider-version"`
	Name                  string   `json:"name"`
	BasePath              string   `json:"base-path"`
	RootPackage           string   `json:"root-package"`
	PackagePath           string   `json:"package-path"`
	BaseCRDVersion        string   `json:"base-crd-version"`
	ProviderConfigVersion string   `json:"provider-config-version"`
	APIGroup              string   `json:"api-group"`
	ExcludeResources      []string `json:"exclude-resources"`
	ExcludeResourceMap    map[string]bool
}

func ConfigFromFile

func ConfigFromFile(path string) (Config, error)

func (Config) IsExcluded

func (c Config) IsExcluded(resourceName string) bool

type PackageImport

type PackageImport struct {
	Name string
	Path string
}

type PackageTranslator

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

func NewPackageTranslator

func NewPackageTranslator(s providers.Schema, namer TerraformResourceNamer, basePath, overlayBasePath string, cfg Config, tg template.TemplateGetter) *PackageTranslator

func (*PackageTranslator) EnsureOutputLocation

func (pt *PackageTranslator) EnsureOutputLocation() error

func (*PackageTranslator) PackageImport

func (pt *PackageTranslator) PackageImport() PackageImport

func (*PackageTranslator) WriteCompareFile

func (pt *PackageTranslator) WriteCompareFile(mr *generator.ManagedResource) error

func (*PackageTranslator) WriteConfigureFile

func (pt *PackageTranslator) WriteConfigureFile() error

func (*PackageTranslator) WriteDecodeFile

func (pt *PackageTranslator) WriteDecodeFile(mr *generator.ManagedResource) error

func (*PackageTranslator) WriteDocFile

func (pt *PackageTranslator) WriteDocFile() error

func (*PackageTranslator) WriteEncoderFile

func (pt *PackageTranslator) WriteEncoderFile(mr *generator.ManagedResource) error

func (*PackageTranslator) WriteIndexFile

func (pt *PackageTranslator) WriteIndexFile() error

func (*PackageTranslator) WriteTypeDefFile

func (pt *PackageTranslator) WriteTypeDefFile(mr *generator.ManagedResource) error

type SchemaTranslator

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

func NewSchemaTranslator

func NewSchemaTranslator(cfg Config, basePath, overlayBasePath string, schema providers.GetSchemaResponse, tg template.TemplateGetter) *SchemaTranslator

func (*SchemaTranslator) WriteGeneratedRuntime

func (st *SchemaTranslator) WriteGeneratedRuntime() error

func (*SchemaTranslator) WriteGeneratedTypes

func (st *SchemaTranslator) WriteGeneratedTypes() error

type SchemaTranslatorConfiguration

type SchemaTranslatorConfiguration struct {
	CRDVersion   string
	PackagePath  string
	ProviderName string
}

type StringTransformer

type StringTransformer func(string) string

func NewTerraformFieldRenamer

func NewTerraformFieldRenamer() StringTransformer

type TerraformResourceNamer

type TerraformResourceNamer interface {
	PackageName() string
	ManagedResourceName() string
	APIVersion() string
	APIGroup() string
	KubernetesVersion() string
	TypeNameGroupKind() string
	TypeNameGroupVersionKind() string
	TerraformResourceName() string
}

func NewTerraformResourceNamer

func NewTerraformResourceNamer(providerName, tfResourceName, apiVersion string) TerraformResourceNamer

Jump to

Keyboard shortcuts

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