Documentation ¶
Index ¶
- Constants
- func ToProviderBlocks(provider string, connectors model.Connectors, opts ConvertOptions) (block.Blocks, error)
- func ToProvidersBlocks(providers []string, connectors model.Connectors, opts ConvertOptions) (blocks block.Blocks, err error)
- type AWSConvertor
- type AlibabaConvertor
- type ConvertOptions
- type Convertor
- type DefaultConvertor
- type DockerConvertor
- type HelmConvertor
- type K8sConvertor
- type K8sConvertorOptions
- type KubectlConvertor
- type Options
Constants ¶
const ( TypeKubernetes = "kubernetes" TypeHelm = "helm" TypeKubectl = "kubectl" TypeAliCloud = "alicloud" TypeAWS = "aws" TypeDocker = "docker" )
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 ConvertOptions ¶
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 ¶
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 DockerConvertor ¶ added in v0.5.0
type DockerConvertor string
func (DockerConvertor) IsSupported ¶ added in v0.5.0
func (m DockerConvertor) IsSupported(connector *model.Connector) bool
func (DockerConvertor) ToBlocks ¶ added in v0.5.0
func (m DockerConvertor) ToBlocks(connectors model.Connectors, opts Options) (block.Blocks, error)
type HelmConvertor ¶
type HelmConvertor string
HelmConvertor mutate the types.ConnectorTypeKubernetes 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.ConnectorTypeKubernetes 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 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)