config

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright paskal.maksim@gmail.com Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright paskal.maksim@gmail.com Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright paskal.maksim@gmail.com Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	AppName = "envoy-control-plane"

	AnnotationCanaryEnabled = AppName + "/canary.enabled"
	CanarySuffix            = "-canary"
)

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig() error

func GetVersion

func GetVersion() string

func Load

func Load() error

func String

func String() string

Types

type ClusterWeight added in v0.4.6

type ClusterWeight struct {
	Value int64
}

type ConfigType

type ConfigType struct {
	ID string `yaml:"id"`
	// used in certificate section common name
	Name string `yaml:"name"`
	// add version to node name
	UseVersionLabel bool `yaml:"useversionlabel"`
	// version label name
	VersionLabelKey string `yaml:"versionlabelkey"`
	// version value
	VersionLabel string
	// source configmap name
	ConfigMapName string
	// source configmap namespace
	ConfigMapNamespace string
	// source configmap annotations
	ConfigMapAnnotations map[string]string
	// kubernetes endpoints
	Kubernetes []KubernetesType `yaml:"kubernetes"`
	// config.endpoint.v3.ClusterLoadAssignment
	Endpoints []interface{} `yaml:"endpoints"`
	// config.route.v3.RouteConfiguration
	Routes []interface{} `yaml:"routes"`
	// config.cluster.v3.Cluster
	Clusters []interface{} `yaml:"clusters"`
	// config.listener.v3.Listener
	Listeners []interface{} `yaml:"listeners"`
	// extensions.transport_sockets.tls.v3.Secret
	Secrets []interface{} `yaml:"secrets"`
	// extensions.transport_sockets.tls.v3.CertificateValidationContext
	Validation interface{} `yaml:"validation"`
	// contains filtered or unexported fields
}

func ParseConfigYaml

func ParseConfigYaml(nodeID string, text string, data interface{}) (*ConfigType, error)

func (*ConfigType) GetClusterWeight added in v0.4.6

func (c *ConfigType) GetClusterWeight(name string) (*ClusterWeight, error)

get user defined weights, return nil if not found.

func (*ConfigType) GetClusters added in v0.4.7

func (c *ConfigType) GetClusters() []types.Resource

func (*ConfigType) GetListeners added in v0.4.7

func (c *ConfigType) GetListeners() []types.Resource

func (*ConfigType) GetRoutes added in v0.4.7

func (c *ConfigType) GetRoutes() []types.Resource

func (*ConfigType) GetSecrets added in v0.4.7

func (c *ConfigType) GetSecrets() []types.Resource

func (*ConfigType) HasClusterWeights added in v0.4.6

func (c *ConfigType) HasClusterWeights() bool

func (*ConfigType) SaveResources added in v0.4.7

func (c *ConfigType) SaveResources() error

type KubernetesType added in v0.4.2

type KubernetesType struct {
	ClusterName     string            `yaml:"cluster_name"` //nolint:tagliatelle
	Namespace       string            `yaml:"namespace"`
	Port            uint32            `yaml:"port"`
	HealthCheckPort uint32            `yaml:"healthcheckport"`
	Priority        uint32            `yaml:"priority"`
	Selector        map[string]string `yaml:"selector"`
	Service         string            `yaml:"service"`
}

type Type

type Type struct {
	GracePeriod           *time.Duration `yaml:"gracePeriod"`
	LogLevel              *string        `yaml:"logLevel"`
	LogPretty             *bool          `yaml:"logPretty"`
	LogAccess             *bool          `yaml:"logAccess"`
	LogPath               *string        `yaml:"logPath"`
	LogReportCaller       *bool          `yaml:"logReportCaller"`
	ConfigFile            *string
	ConfigMapLabels       *string        `yaml:"configMapLabels"`
	ConfigMapNames        *string        `yaml:"configMapNames"`
	KubeConfigFile        *string        `yaml:"kubeConfigFile"`
	WatchNamespaced       *bool          `yaml:"watchNamespaced"`
	LeaderElection        *bool          `yaml:"leaderElection"`
	PodName               *string        `yaml:"podName"`
	Namespace             *string        `yaml:"namespace"`
	GrpcAddress           *string        `yaml:"grpcAddress"`
	WebHTTPAddress        *string        `yaml:"webHttpAddress"`
	WebHTTPSAddress       *string        `yaml:"webHttpsAddress"`
	NodeZoneLabel         *string        `yaml:"nodeZoneLabel"`
	ConfigDrainPeriod     *time.Duration `yaml:"configDrainPeriod"`
	EndpointCheckPeriod   *time.Duration `yaml:"endpointCheckPeriod"`
	SentryDSN             *string        `yaml:"sentryDsn"`
	SSLName               *string        `yaml:"sslName"`
	SSLCrt                *string        `yaml:"sslCrt"`
	SSLKey                *string        `yaml:"sslKey"`
	SSLDoNotUseValidation *bool          `yaml:"sslDoNotUseValidation"`
	SSLRotationPeriod     *time.Duration `yaml:"sslRotationPeriod"`
	WebAdminUser          *string        `yaml:"webAdminUser"`
	WebAdminPassword      *string        `yaml:"webAdminPassword"`
}

func Get

func Get() *Type

Jump to

Keyboard shortcuts

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