config

package
v0.0.155 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadClusterConfig added in v0.0.5

func LoadClusterConfig() (armometadata.ClusterConfig, error)

func LoadServiceURLs added in v0.0.5

func LoadServiceURLs(apiURL string) (schema.IBackendServices, error)

Types

type AuthenticationServerConfig added in v0.0.5

type AuthenticationServerConfig struct {
	Url                       string            `mapstructure:"url"`
	HeaderToQueryParamMapping map[string]string `mapstructure:"headerToQueryParamMapping"`
	HeaderToHeaderMapping     map[string]string `mapstructure:"headerToHeaderMapping"`
}

type Backend

type Backend struct {
	Port                 int                         `mapstructure:"port"`
	AuthenticationServer *AuthenticationServerConfig `mapstructure:"authenticationServer"`
	Subscription         string                      `mapstructure:"subscription"`
	PulsarConfig         *pulsarconfig.PulsarConfig  `mapstructure:"pulsarConfig"`
	ProducerTopic        pulsarconnector.TopicName   `mapstructure:"producerTopic"`
	ConsumerTopic        pulsarconnector.TopicName   `mapstructure:"consumerTopic"`
	ConsumerWorkers      int                         `mapstructure:"consumerWorkers"`
	Prometheus           *PrometheusConfig           `mapstructure:"prometheusConfig"`
	ReconciliationTask   *ReconciliationTaskConfig   `mapstructure:"reconciliationTaskConfig"`
	KeepAliveTask        *KeepAliveTaskConfig        `mapstructure:"keepAliveTaskConfig"`
	SkipAlertsFrom       []string                    `mapstructure:"skipAlertsFrom"`
	FeaturesProvider     *FeaturesProviderConfig     `mapstructure:"featuresProvider"`
	MessageQueue         *MessageQueueConfig         `mapstructure:"messageQueue"`
}

type Config

type Config struct {
	Backend      Backend      `mapstructure:"backend"`
	InCluster    InCluster    `mapstructure:"inCluster"`
	HTTPEndpoint HTTPEndpoint `mapstructure:"httpEndpoint"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads configuration from file or environment variables.

type FeaturesProviderConfig added in v0.0.136

type FeaturesProviderConfig struct {
	FeatureFlagName        string `mapstructure:"featureFlagName"`
	RefreshIntervalSeconds int    `mapstructure:"refreshIntervalSeconds"`
}

type HTTPEndpoint added in v0.0.67

type HTTPEndpoint struct {
	ServerPort string     `mapstructure:"serverPort"`
	Resources  []Resource `mapstructure:"resources"`
}

func (*HTTPEndpoint) ValidateConfig added in v0.0.67

func (c *HTTPEndpoint) ValidateConfig() error

type InCluster

type InCluster struct {
	ServerUrl         string     `mapstructure:"serverUrl"`
	Namespace         string     `mapstructure:"namespace"`
	ClusterName       string     `mapstructure:"clusterName"`
	ExcludeNamespaces []string   `mapstructure:"excludeNamespaces"`
	IncludeNamespaces []string   `mapstructure:"includeNamespaces"`
	Account           string     `mapstructure:"account"`
	AccessKey         string     `mapstructure:"accessKey"`
	Resources         []Resource `mapstructure:"resources"`
}

func (*InCluster) ValidateConfig added in v0.0.5

func (c *InCluster) ValidateConfig() error

type KafkaConfig added in v0.0.155

type KafkaConfig struct {
	BootstrapServers []string `mapstructure:"bootstrapServers"`
	ProducerTopic    string   `mapstructure:"producerTopic"` // server produces here; carries cluster -> backend traffic (.out), consumed by the event ingester
	ConsumerTopic    string   `mapstructure:"consumerTopic"` // server consumes here; carries backend -> cluster traffic (.in), produced by backend services
	GroupIDPrefix    string   `mapstructure:"groupIdPrefix"`
	CompressionType  string   `mapstructure:"compressionType"` // default "zstd"
	MaxMessageBytes  int      `mapstructure:"maxMessageBytes"` // default 67108864 (64 MB)
	// Security fields are parsed now but only PLAINTEXT is honored in this phase;
	// SASL/TLS enforcement ships in the immediate follow-up.
	SecurityProtocol string `mapstructure:"securityProtocol"` // PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL
	SASLMechanism    string `mapstructure:"saslMechanism"`
	SASLUsername     string `mapstructure:"saslUsername"`
	SASLPassword     string `mapstructure:"saslPassword"`
	TLSEnabled       bool   `mapstructure:"tlsEnabled"`
	TLSCaCertPath    string `mapstructure:"tlsCaCertPath"`
}

type KeepAliveTaskConfig added in v0.0.64

type KeepAliveTaskConfig struct {
	TaskIntervalSeconds int `mapstructure:"taskIntervalSeconds"`
}

type MessageQueueConfig added in v0.0.155

type MessageQueueConfig struct {
	Type        string       `mapstructure:"type"` // "kafka"
	KafkaConfig *KafkaConfig `mapstructure:"kafkaConfig"`
}

MessageQueueConfig selects the message queue backend. When Type is set it takes precedence over the legacy top-level PulsarConfig; when it is absent the server falls back to PulsarConfig (see adapters/backend/v1/factory.go).

type PrometheusConfig added in v0.0.38

type PrometheusConfig struct {
	Enabled bool `mapstructure:"enabled"`
	Port    int  `mapstructure:"port"`
}

type ReconciliationTaskConfig added in v0.0.47

type ReconciliationTaskConfig struct {
	CronSchedule                  string `mapstructure:"cronSchedule"` // when this is set, taskIntervalSeconds is ignored
	TaskIntervalSeconds           int    `mapstructure:"taskIntervalSeconds"`
	IntervalFromConnectionSeconds int    `mapstructure:"intervalFromConnectionSeconds"`
	SendBatch                     bool   `mapstructure:"sendBatch"` // if true, a single message will be sent for all connected clients
}

type Resource

type Resource struct {
	Group    string          `mapstructure:"group"`
	Version  string          `mapstructure:"version"`
	Resource string          `mapstructure:"resource"`
	Strategy domain.Strategy `mapstructure:"strategy"`
}

func (Resource) String

func (r Resource) String() string

Kind returns group/version/resource as a string.

Jump to

Keyboard shortcuts

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