Documentation ¶
Index ¶
- Constants
- Variables
- func ErrGetLatestReleases(err error) error
- func ErrGetManifestNames(err error) error
- func GetFileNames(owner string, repo string, path string) ([]string, error)
- func New(provider string) (h config.Handler, err error)
- func NewKubeconfigBuilder(provider string) (config.Handler, error)
- func RootPath() string
- type Asset
- type Release
Constants ¶
View Source
const ( // OAM Metadata constants OAMAdapterNameMetadataKey = "adapter.meshery.io/name" OAMComponentCategoryMetadataKey = "ui.meshery.io/category" )
View Source
const ( // ErrGetLatestReleasesCode represents the error which occurs during the process of getting // latest releases ErrGetLatestReleasesCode = "1008" // ErrGetManifestNamesCode represents the error which occurs during the process of getting // manifest names ErrGetManifestNamesCode = "1009" // ErrEmptyConfigCode represents the error when the configuration is either empty // or is invalid ErrEmptyConfigCode = "1010" )
View Source
const ( CustomOperation = "custom" Consul182DemoOperation = "consul_182_demo" Consul191DemoOperation = "consul_191_demo" BookInfoOperation = "bookinfo" HTTPBinOperation = "httpbin" ImageHubOperation = "imagehub" // Keys in AdditionalProperties of Operation HelmChartRepositoryKey = "helm_chart_repository" HelmChartChartKey = "helm_chart_chart" HelmChartVersionKey = "helm_chart_version" HelmChartValuesFileKey = "helm_chart_values_file" )
Variables ¶
View Source
var ( ServerDefaults = map[string]string{ "name": smp.ServiceMesh_CONSUL.Enum().String(), "type": "adapter", "port": "10002", "traceurl": "none", } MeshSpecDefaults = map[string]string{ "name": smp.ServiceMesh_CONSUL.Enum().String(), "status": status.NotInstalled, "version": "1.8.2", } ViperDefaults = map[string]string{ "filepath": ConfigRootPath, "filename": "consul", "filetype": "yaml", } KubeConfigDefaults = map[string]string{ configprovider.FilePath: ConfigRootPath, configprovider.FileType: "yaml", configprovider.FileName: "kubeconfig", } // Operations represents the set of valid operations that are available // to the adapter Operations = getOperations(common.Operations) )
View Source
var (
ConfigRootPath = path.Join(utils.GetHome(), ".meshery")
)
View Source
var (
ConsulOperation = strings.ToLower(smp.ServiceMesh_CONSUL.Enum().String())
)
View Source
var ( // ErrEmptyConfig error is the error when config is invalid ErrEmptyConfig = errors.New(ErrEmptyConfigCode, errors.Alert, []string{"Config is empty"}, []string{}, []string{}, []string{}) )
Functions ¶
func ErrGetLatestReleases ¶
ErrGetLatestReleases is the error for fetching consul releases
func ErrGetManifestNames ¶
ErrGetManifestNames is the error for fetching consul manifest names
func GetFileNames ¶
GetFileNames takes the url of a github repo and the path to a directory. Then returns all the filenames from that directory
func NewKubeconfigBuilder ¶
NewKubeconfigBuilder returns a config handler based on the provider
Valid providers are "viper" and "in-mem"
Types ¶
type Asset ¶
type Asset struct { Name string `json:"name,omitempty"` State string `json:"state,omitempty"` DownloadURL string `json:"browser_download_url,omitempty"` }
Asset describes the github release asset object
type Release ¶
type Release struct { ID int `json:"id,omitempty"` TagName string `json:"tag_name,omitempty"` Name adapter.Version `json:"name,omitempty"` Draft bool `json:"draft,omitempty"` Assets []*Asset `json:"assets,omitempty"` }
Release is used to save the release informations
func GetLatestReleases ¶
GetLatestReleases fetches the latest releases from the Consul mesh repository
Click to show internal directories.
Click to hide internal directories.