config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomConfig

type CustomConfig struct {
	// Attributes is the custom connector attribute
	// e.g. access_key, secret_key, etc.
	Attributes map[string]any `json:"attributes"`

	// TODO add block support, some custom connector may need Dependencies(blocks)
	// Dependencies is the dependencies of the custom connector.
	Dependencies []Dependency `json:"dependencies"`
}

CustomConfig is the config of a custom connector. It is used to generate the custom connector config. E.g. A custom helm connector

configData := CustomConfig{
	Attributes: map[string]any{
		"access_url": "http://localhost:8080",
	},
	Dependencies: []Dependency{
		{
			Type: "kubernetes",
			Label: []string{},
			Attributes: map[string]any{
				"config_path": "/home/user/.kube/config",
			},
		},
	},
}

This will generate the following terraform provider.

provider "helm" {
	access_url = "http://localhost:8080"
	kubernetes {
		config_path = "/home/user/.kube/config"
	}
}

func LoadCustomConfig

func LoadCustomConfig(c *model.Connector) (*CustomConfig, error)

LoadCustomConfig loads the custom connector config from the connector.

type Dependency

type Dependency struct {
	Type       string         `json:"type"`
	Label      []string       `json:"label"`
	Attributes map[string]any `json:"attributes"`

	Children []Dependency `json:"children"`
}

Dependency is the dependency of a custom connector.

Jump to

Keyboard shortcuts

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