config

package
v1.22.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultLoadBalancerClass is the default load balancer class
	DefaultLoadBalancerClass = "default"
)

Variables

LoadBalancerSizes contains the valid size names

Functions

This section is empty.

Types

type LBConfig

type LBConfig struct {
	LoadBalancer      LoadBalancerConfig
	LoadBalancerClass map[string]*LoadBalancerClassConfig
}

LBConfig is used to read and store information from the cloud configuration file

func ReadConfigINI

func ReadConfigINI(byConfig []byte) (*LBConfig, error)

ReadConfigINI parses vSphere cloud config file and stores it into Config

func ReadConfigYAML

func ReadConfigYAML(byConfig []byte) (*LBConfig, error)

ReadConfigYAML parses vSphere cloud config file and stores it into Config

func ReadLBConfig

func ReadLBConfig(byConfig []byte) (*LBConfig, error)

ReadLBConfig parses vSphere cloud config file and stores it into VSphereConfig. Environment variables are also checked

func (*LBConfig) IsEnabled

func (cfg *LBConfig) IsEnabled() bool

IsEnabled checks whether the load balancer feature is enabled It is enabled if any flavor of the load balancer configuration is given.

type LBConfigINI

type LBConfigINI struct {
	LoadBalancer      LoadBalancerConfigINI                  `gcfg:"loadbalancer"`
	LoadBalancerClass map[string]*LoadBalancerClassConfigINI `gcfg:"loadbalancerclass"`
}

LBConfigINI is used to read and store information from the cloud configuration file

func ReadRawConfigINI

func ReadRawConfigINI(byConfig []byte) (*LBConfigINI, error)

ReadRawConfigINI parses vSphere cloud config file and stores it into ConfigINI

func (*LBConfigINI) CompleteAndValidate

func (lbc *LBConfigINI) CompleteAndValidate() error

CompleteAndValidate sets default values, overrides by env and validates the resulting config

func (*LBConfigINI) CreateConfig

func (lbc *LBConfigINI) CreateConfig() *LBConfig

CreateConfig generates a common Config object based on what other structs and funcs are already dependent upon in other packages.

type LBConfigYAML

type LBConfigYAML struct {
	LoadBalancer      LoadBalancerConfigYAML                  `yaml:"loadBalancer"`
	LoadBalancerClass map[string]*LoadBalancerClassConfigYAML `yaml:"loadBalancerClass"`
}

LBConfigYAML is used to read and store information from the cloud configuration file

func ReadRawConfigYAML

func ReadRawConfigYAML(byConfig []byte) (*LBConfigYAML, error)

ReadRawConfigYAML parses vSphere cloud config file and stores it into ConfigYAML

func (*LBConfigYAML) CompleteAndValidate

func (lbc *LBConfigYAML) CompleteAndValidate() error

CompleteAndValidate sets default values, overrides by env and validates the resulting config

func (*LBConfigYAML) CreateConfig

func (lbc *LBConfigYAML) CreateConfig() *LBConfig

CreateConfig generates a common Config object based on what other structs and funcs are already dependent upon in other packages.

type LoadBalancerClassConfig

type LoadBalancerClassConfig struct {
	IPPoolName        string
	IPPoolID          string
	TCPAppProfileName string
	TCPAppProfilePath string
	UDPAppProfileName string
	UDPAppProfilePath string
}

LoadBalancerClassConfig contains the configuration for a load balancer class

type LoadBalancerClassConfigINI

type LoadBalancerClassConfigINI struct {
	IPPoolName        string `gcfg:"ip-pool-name"`
	IPPoolID          string `gcfg:"ip-pool-id"`
	TCPAppProfileName string `gcfg:"tcp-app-profile-name"`
	TCPAppProfilePath string `gcfg:"tcp-app-profile-path"`
	UDPAppProfileName string `gcfg:"udp-app-profile-name"`
	UDPAppProfilePath string `gcfg:"udp-app-profile-path"`
}

LoadBalancerClassConfigINI contains the configuration for a load balancer class

type LoadBalancerClassConfigYAML

type LoadBalancerClassConfigYAML struct {
	IPPoolName        string `yaml:"ipPoolName"`
	IPPoolID          string `yaml:"ipPoolId"`
	TCPAppProfileName string `yaml:"tcpAppProfileName"`
	TCPAppProfilePath string `yaml:"tcpAppProfilePath"`
	UDPAppProfileName string `yaml:"udpAppProfileName"`
	UDPAppProfilePath string `yaml:"udpAppProfilePath"`
}

LoadBalancerClassConfigYAML contains the configuration for a load balancer class

type LoadBalancerConfig

type LoadBalancerConfig struct {
	LoadBalancerClassConfig
	Size             string
	LBServiceID      string
	Tier1GatewayPath string
	AdditionalTags   map[string]string
}

LoadBalancerConfig contains the configuration for the load balancer itself

func (*LoadBalancerConfig) IsEmpty

func (cfg *LoadBalancerConfig) IsEmpty() bool

IsEmpty checks whether the load balancer config is empty (no values specified)

type LoadBalancerConfigINI

type LoadBalancerConfigINI struct {
	LoadBalancerClassConfigINI
	Size             string `gcfg:"size"`
	LBServiceID      string `gcfg:"lb-service-id"`
	Tier1GatewayPath string `gcfg:"tier1-gateway-path"`
	RawTags          string `gcfg:"tags"`
	AdditionalTags   map[string]string
}

LoadBalancerConfigINI contains the configuration for the load balancer itself

type LoadBalancerConfigYAML

type LoadBalancerConfigYAML struct {
	Size             string            `yaml:"size"`
	LBServiceID      string            `yaml:"lbServiceId"`
	Tier1GatewayPath string            `yaml:"tier1GatewayPath"`
	AdditionalTags   map[string]string `yaml:"tags"`

	// this struct use to inherit from LoadBalancerClassConfigYAML, but the YAML parser
	// wasnt able to indirectly parse inherited fields
	IPPoolName        string `yaml:"ipPoolName"`
	IPPoolID          string `yaml:"ipPoolId"`
	TCPAppProfileName string `yaml:"tcpAppProfileName"`
	TCPAppProfilePath string `yaml:"tcpAppProfilePath"`
	UDPAppProfileName string `yaml:"udpAppProfileName"`
	UDPAppProfilePath string `yaml:"udpAppProfilePath"`
}

LoadBalancerConfigYAML contains the configuration for the load balancer itself

Jump to

Keyboard shortcuts

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