config

package
v0.0.0-...-4b6be33 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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

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

	ErrGetManifestNamesCode = "1024"
)

Variables

View Source
var (
	CiliumOperation = strings.ToLower(smp.ServiceMesh_CILIUM_SERVICE_MESH.Enum().String())

	ServerDefaults = map[string]string{
		"name":     smp.ServiceMesh_CILIUM_SERVICE_MESH.Enum().String(),
		"type":     "adapter",
		"port":     "10012",
		"traceurl": status.None,
	}

	MeshSpecDefaults = map[string]string{
		"name":    smp.ServiceMesh_CILIUM_SERVICE_MESH.Enum().String(),
		"status":  status.NotInstalled,
		"version": status.None,
	}

	ProviderConfigDefaults = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "cilium",
	}

	KubeConfigDefaults = map[string]string{
		configprovider.FilePath: configRootPath,
		configprovider.FileType: "yaml",
		configprovider.FileName: "kubeconfig",
	}

	Operations = getOperations(common.Operations)
)
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{})
)
View Source
var (
	ServiceName = "service_name"
)

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 ErrGetManifestNames

func ErrGetManifestNames(err error) error

ErrGetManifestNames is the error for fetching consul manifest names

func GetFileNames

func GetFileNames(owner string, repo string, path string) ([]string, error)

GetFileNames takes the url of a github repo and the path to a directory. Then returns all the filenames from that directory

func New

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

func NewKubeconfigBuilder

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

func RootPath

func RootPath() string

RootPath returns the root config path

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

Jump to

Keyboard shortcuts

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