convertor

package
v0.3.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeKubernetes = "kubernetes"
	TypeHelm       = "helm"
	TypeKubectl    = "kubectl"
	TypeAliCloud   = "alicloud"
	TypeAWS        = "aws"
)

Variables

This section is empty.

Functions

func ToProviderBlocks

func ToProviderBlocks(provider string, connectors model.Connectors, opts ConvertOptions) (block.Blocks, error)

ToProviderBlocks converts the connectors to blocks with provider name.

func ToProvidersBlocks

func ToProvidersBlocks(
	providers []string,
	connectors model.Connectors,
	opts ConvertOptions,
) (blocks block.Blocks, err error)

ToProvidersBlocks converts the connectors to provider blocks with required providers.

Types

type AWSConvertor

type AWSConvertor string

func (AWSConvertor) IsSupported

func (m AWSConvertor) IsSupported(connector *model.Connector) bool

func (AWSConvertor) ToBlocks

func (m AWSConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)

type AlibabaConvertor

type AlibabaConvertor string

func (AlibabaConvertor) IsSupported

func (m AlibabaConvertor) IsSupported(connector *model.Connector) bool

func (AlibabaConvertor) ToBlocks

func (m AlibabaConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)

type CloudProviderConvertorOptions

type CloudProviderConvertorOptions struct {
	ConnSeparator string
}

type ConvertOptions

type ConvertOptions struct {
	SecretMountPath string
	ConnSeparator   string
	Providers       []string
}

type Convertor

type Convertor interface {
	// IsSupported checks if the connector is supported by the convertor.
	IsSupported(*model.Connector) bool
	// ToBlocks converts the connectors to provider blocks.
	ToBlocks(model.Connectors, Options) (block.Blocks, error)
}

Convertor converts the connector to provider block. E.g. ConnectorType(kubernetes) connector to ProviderType(kubernetes) provider block. ConnectorType(kubernetes) connector to ProviderType(helm) provider block.

func LoadConvertor

func LoadConvertor(provider string) Convertor

LoadConvertor loads the convertor by the provider type.

type DefaultConvertor

type DefaultConvertor string

DefaultConvertor is the convertor for custom category connector.

func (DefaultConvertor) IsSupported

func (m DefaultConvertor) IsSupported(connector *model.Connector) bool

func (DefaultConvertor) ToBlocks

func (m DefaultConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)

type HelmConvertor

type HelmConvertor string

HelmConvertor mutate the types.ConnectorTypeK8s connector to TypeHelm provider block.

func (HelmConvertor) IsSupported

func (m HelmConvertor) IsSupported(connector *model.Connector) bool

func (HelmConvertor) ToBlocks

func (m HelmConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)

type K8sConvertor

type K8sConvertor string

K8sConvertor mutate the types.ConnectorTypeK8s connector to Kubernetes provider block.

func (K8sConvertor) IsSupported

func (m K8sConvertor) IsSupported(connector *model.Connector) bool

func (K8sConvertor) ToBlocks

func (m K8sConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)

type K8sConvertorOptions

type K8sConvertorOptions struct {
	ConfigPath    string
	ConnSeparator string
	GetSecretName func(string) string
}

type KubectlConvertor

type KubectlConvertor string

func (KubectlConvertor) IsSupported

func (m KubectlConvertor) IsSupported(connector *model.Connector) bool

func (KubectlConvertor) ToBlocks

func (m KubectlConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)

type Options

type Options = any

Jump to

Keyboard shortcuts

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