config

package
v0.0.0-...-c8bc4d7 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerKey                 = "server-config"
	PipelineNameKey           = "meshsync-pipeline"
	ResourcesKey              = "resources"
	GlobalResourceKey         = "global"
	LocalResourceKey          = "local"
	ListenersKey              = "listeners"
	LogStreamsKey             = "log-streams"
	PatternResourceIDLabelKey = "resource.pattern.meshplay.io/id"

	BrokerURL     = "broker-url"
	RequestStream = "request-stream"
	LogStream     = "log-stream"
	ExecShell     = "exec-shell"
	InformerStore = "informer-store"
)
View Source
const (
	ErrInitConfigCode = "1000"
)

Variables

View Source
var (
	Server = map[string]string{
		"name":      "meshplay-meshsync",
		"port":      "11000",
		"version":   "latest",
		"startedat": time.Now().String(),
	}

	Pipelines = map[string]PipelineConfigs{
		GlobalResourceKey: []PipelineConfig{

			{
				Name:      "namespaces.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "configmaps.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "nodes.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "secrets.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "persistentvolumes.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "persistentvolumeclaims.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
		},
		LocalResourceKey: []PipelineConfig{

			{
				Name:      "replicasets.v1.apps",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "pods.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "services.v1.",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "deployments.v1.apps",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "statefulsets.v1.apps",
				PublishTo: "meshplay.meshsync.core",
			},
			{
				Name:      "daemonsets.v1.apps",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "ingresses.v1.networking.k8s.io",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "endpoints.v1.",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "endpointslices.v1.discovery.k8s.io",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "cronjobs.v1.batch",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "replicationcontrollers.v1.",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "storageclasses.v1.storage.k8s.io",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "clusterroles.v1.rbac.authorization.k8s.io",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "volumeattachments.v1.storage.k8s.io",
				PublishTo: "meshplay.meshsync.core",
			},

			{
				Name:      "apiservices.v1.apiregistration.k8s.io",
				PublishTo: "meshplay.meshsync.core",
			},
		},
	}

	Listeners = map[string]ListenerConfig{
		LogStream: {
			Name:           LogStream,
			ConnectionName: "meshsync-logstream",
			PublishTo:      "meshplay.meshsync.logs",
		},
		ExecShell: {
			Name:           ExecShell,
			ConnectionName: "meshsync-exec",
			PublishTo:      "meshplay.meshsync.exec",
		},
		RequestStream: {
			Name:           RequestStream,
			ConnectionName: "meshsync-request-stream",
			SubscribeTo:    "meshplay.meshsync.request",
		},
	}
)

Functions

func ErrInitConfig

func ErrInitConfig(err error) error

func New

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

New creates a new config instance

Types

type ListenerConfig

type ListenerConfig struct {
	Name           string `json:"name" yaml:"name"`
	ConnectionName string `json:"connection-name" yaml:"connection-name"`
	PublishTo      string `json:"publish-to" yaml:"publish-to"`
	SubscribeTo    string `json:"subscribe-to" yaml:"subscribe-to"`
}

type ListenerConfigs

type ListenerConfigs []ListenerConfig

type PipelineConfig

type PipelineConfig struct {
	Name      string `json:"name" yaml:"name"`
	PublishTo string `json:"publish-to" yaml:"publish-to"`
}

type PipelineConfigs

type PipelineConfigs []PipelineConfig

Jump to

Keyboard shortcuts

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