config

package
v0.26.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ProviderNamespace = "huawei-cloud-provider"

	HealthCheckTimeout    = 3
	HealthCheckMaxRetries = 3
	HealthCheckDelay      = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOptions

type AuthOptions struct {
	Cloud     string `gcfg:"cloud"`
	AuthURL   string `gcfg:"auth-url"`
	Region    string `gcfg:"region"`
	AccessKey string `gcfg:"access-key"`
	SecretKey string `gcfg:"secret-key"`
	ProjectID string `gcfg:"project-id"`
}

func (*AuthOptions) GetCredentials

func (a *AuthOptions) GetCredentials() *basic.Credentials

func (*AuthOptions) GetHcClient

func (a *AuthOptions) GetHcClient(catalogName string) *core.HcHttpClient

type CloudConfig

type CloudConfig struct {
	AuthOpts AuthOptions `gcfg:"Global"`
	VpcOpts  VpcOptions  `gcfg:"Vpc"`
}

CloudConfig define

func ReadConfig

func ReadConfig(cfg io.Reader) (*CloudConfig, error)

type HealthCheckOption

type HealthCheckOption struct {
	Enable     bool   `json:"enable"`
	Delay      int32  `json:"delay"`
	Timeout    int32  `json:"timeout"`
	MaxRetries int32  `json:"max_retries"`
	Protocol   string `json:"protocol"`
	Path       string `json:"path"`
}

type LoadBalancerOptions

type LoadBalancerOptions struct {
	LBAlgorithm string `json:"lb-algorithm"`
	LBProvider  string `json:"lb-provider"`
	KeepEIP     bool   `json:"keep-eip"`

	EnableCrossVpc bool   `json:"enable-cross-vpc"`
	L4FlavorID     string `json:"l4-flavor-id"`
	L7FlavorID     string `json:"l7-flavor-id"`

	SessionAffinityOption elbmodel.SessionPersistence `json:"session-affinity-option"`
	SessionAffinityFlag   string                      `json:"session-affinity-flag"`

	EnableTransparentClientIP bool `json:"enable-transparent-client-ip"`

	IdleTimeout     int `json:"idle-timeout"`
	RequestTimeout  int `json:"request-timeout"`
	ResponseTimeout int `json:"response-timeout"`

	HealthCheckFlag   string            `json:"health-check-flag"`
	HealthCheckOption HealthCheckOption `json:"health-check-option"`

	DisableCreateSecurityGroup bool   `json:"disable-create-security-group"`
	LoadBalancerClass          string `json:"loadbalancer-class"`
	BusinessName               string `json:"business-name"`
	PrimaryNic                 string `json:"primary-nic"`
}

type LoadbalancerConfig

type LoadbalancerConfig struct {
	LoadBalancerOpts LoadBalancerOptions `json:"loadBalancerOption"`
	NetworkingOpts   NetworkingOptions   `json:"networkingOption"`
	MetadataOpts     MetadataOptions     `json:"metadataOption"`
}

func LoadELBConfig

func LoadELBConfig(data map[string]string) *LoadbalancerConfig

func LoadElbConfigFromCM

func LoadElbConfigFromCM() (*LoadbalancerConfig, error)

func NewDefaultELBConfig

func NewDefaultELBConfig() *LoadbalancerConfig

type MetadataOptions

type MetadataOptions struct {
	SearchOrder string `json:"search-order"`
}

MetadataOptions is used for configuring how to talk to metadata service or authConfig drive

type NetworkingOptions

type NetworkingOptions struct {
	PublicNetworkName   []string `json:"public-network-name"`
	InternalNetworkName []string `json:"internal-network-name"`
}

NetworkingOptions is used for networking settings

type VpcOptions

type VpcOptions struct {
	ID              string `gcfg:"id"`
	SubnetID        string `gcfg:"subnet-id"`
	SecurityGroupID string `gcfg:"security-group-id"`
}

Jump to

Keyboard shortcuts

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