config

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OAM metadata constants
	OAMAdapterNameMetadataKey       = "adapter.meshery.io/name"
	OAMComponentCategoryMetadataKey = "ui.meshery.io/category"
)
View Source
const (
	// ErrEmptyConfigCode represents the error when the configuration is either empty
	// or is invalid
	ErrEmptyConfigCode = "1029"

	// ErrGetLatestReleasesCode represents the error which occurs during the process of getting
	// latest releases
	ErrGetLatestReleasesCode = "1030"

	// ErrGetLatestReleaseNamesCode represents the error which occurs during the process of extracting
	// release names
	ErrGetLatestReleaseNamesCode = "1031"
)

Variables

View Source
var (
	// TraefikMeshOperation is the default name for the install
	// and uninstall commands on the traefik mesh
	TraefikMeshOperation = strings.ToLower(smp.ServiceMesh_TRAEFIK_MESH.Enum().String())

	// ServerConfig is the configuration for the gRPC server
	ServerConfig = map[string]string{
		"name":     smp.ServiceMesh_TRAEFIK_MESH.Enum().String(),
		"port":     "10006",
		"type":     "adapter",
		"traceurl": status.None,
	}

	// MeshSpec is the spec for the service mesh associated with this adapter
	MeshSpec = map[string]string{
		"name":    smp.ServiceMesh_TRAEFIK_MESH.Enum().String(),
		"status":  status.None,
		"version": status.None,
	}

	// ProviderConfig is the config for the configuration provider
	ProviderConfig = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "traefik-mesh",
	}

	// KubeConfig - Controlling the kubeconfig lifecycle with viper
	KubeConfig = 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 (
	TraefikOperation          = strings.ToLower(smp.ServiceMesh_TRAEFIK_MESH.Enum().String())
	TraefikBookStoreOperation = "traefik_bookstore_app"
	ServiceName               = "service_name"
)
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 ErrGetLatestReleaseNames

func ErrGetLatestReleaseNames(err error) error

ErrGetLatestReleaseNames is the error for fetching nsm-mesh releases

func ErrGetLatestReleases

func ErrGetLatestReleases(err error) error

ErrGetLatestReleases is the error for fetching nsm-mesh releases

func New

func New(provider string) (h config.Handler, err error)

New creates a new config instance

func NewKubeconfigBuilder

func NewKubeconfigBuilder(provider string) (config.Handler, error)

NewKubeconfigBuilder returns a config handler based on the provider

Valid prividers are "viper" and "in-mem"

func RootPath

func RootPath() string

RootPath returns the config root path for the adapter

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

func GetLatestReleases(releases uint) ([]*Release, error)

GetLatestReleases fetches the latest releases from the traefik mesh repository

Jump to

Keyboard shortcuts

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