config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Linked     = ProxyMode("Linked")
	StandAlone = ProxyMode("StandAlone")
)

Constants for the proxy configuration Linked :- In linked mode, proxy simply forwards, will be obsolete

all the request to one of the configured
primary or backup unispheres based on a fail-over
mechanism which is triggered automatically, in case one
of the unispheres go down.

StandAlone :- In stand-alone mode, proxy provides multi-array

				 support with ACL to authenticate and authorize
              users based on credentials set via k8s secrets.
              Each array can have a primary and a backup unisphere
              which follows the same fail-over mechanism as Linked
              proxy

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkConfig

type LinkConfig struct {
	Primary ManagementServerConfig `yaml:"primary" mapstructure:"primary"`
	Backup  ManagementServerConfig `yaml:"backup,omitempty" mapstructure:"backup"`
}

LinkConfig - represents linked proxy configuration in the config file

type LinkedProxyConfig

type LinkedProxyConfig struct {
	Primary *ManagementServer
	Backup  *ManagementServer
}

LinkedProxyConfig - represents a configuration of the Linked Proxy (formed using LinkConfig)

type ManagementServer

type ManagementServer struct {
	URL                       url.URL
	StorageArrayIdentifiers   []string
	Credentials               common.Credentials
	CredentialSecret          string
	SkipCertificateValidation bool
	CertFile                  string
	CertSecret                string
	Limits                    common.Limits
}

ManagementServer - represents a Management Server (formed using ManagementServerConfig)

type ManagementServerConfig

type ManagementServerConfig struct {
	URL                       string        `yaml:"url"`
	ArrayCredentialSecret     string        `yaml:"arrayCredentialSecret,omitempty"`
	SkipCertificateValidation bool          `yaml:"skipCertificateValidation,omitempty"`
	CertSecret                string        `yaml:"certSecret,omitempty"`
	Limits                    common.Limits `yaml:"limits,omitempty" mapstructure:"limits"`
}

ManagementServerConfig - represents a management server configuration for the management server

type ProxyConfig

type ProxyConfig struct {
	Mode                  ProxyMode
	Port                  string
	LinkProxyConfig       *LinkedProxyConfig
	StandAloneProxyConfig *StandAloneProxyConfig
}

ProxyConfig - represents the configuration of Proxy (formed using ProxyConfigMap)

func NewProxyConfig

func NewProxyConfig(configMap *ProxyConfigMap, k8sUtils k8sutils.UtilsInterface) (*ProxyConfig, error)

NewProxyConfig - returns a new proxy config given a proxy config map

func (*ProxyConfig) ParseConfig

func (proxyConfig *ProxyConfig) ParseConfig(proxyConfigMap ProxyConfigMap, k8sUtils k8sutils.UtilsInterface) error

ParseConfig - Parses a given proxy config map

type ProxyConfigMap

type ProxyConfigMap struct {
	Mode             ProxyMode         `yaml:"mode,omitempty"`
	Port             string            `yaml:"port,omitempty"`
	LogLevel         string            `yaml:"logLevel,omitempty"`
	LogFormat        string            `yaml:"logFormat,omitempty"`
	LinkConfig       *LinkConfig       `yaml:"linkConfig,omitempty" mapstructure:"linkConfig"`
	StandAloneConfig *StandAloneConfig `yaml:"standAloneConfig,omitempty" mapstructure:"standAloneConfig"`
}

ProxyConfigMap - represents the configuration file

func ReadConfig

func ReadConfig(configFile string) (*ProxyConfigMap, error)

ReadConfig - uses viper to read the config from the config map

type ProxyCredentialSecret

type ProxyCredentialSecret struct {
	Credentials      common.Credentials
	CredentialSecret string
}

ProxyCredentialSecret is used for storing a credential for a secret

type ProxyMode

type ProxyMode string

ProxyMode represents the mode the proxy is operating in

type ProxyUser

type ProxyUser struct {
	StorageArrayIdentifiers []string
	ProxyCredential         common.Credentials
}

ProxyUser - used for storing a proxy user and list of associated storage array identifiers

type StandAloneConfig

type StandAloneConfig struct {
	StorageArrayConfig     []StorageArrayConfig     `yaml:"storageArrays" mapstructure:"storageArrays"`
	ManagementServerConfig []ManagementServerConfig `yaml:"managementServers" mapstructure:"managementServers"`
}

StandAloneConfig - represents stand alone proxy configuration in the config file

type StandAloneProxyConfig

type StandAloneProxyConfig struct {
	// contains filtered or unexported fields
}

StandAloneProxyConfig - represents Stand Alone Proxy Config (formed using StandAloneConfig)

func (*StandAloneProxyConfig) GetManagedArraysAndServers

func (proxy *StandAloneProxyConfig) GetManagedArraysAndServers() map[string]StorageArrayServer

GetManagedArraysAndServers returns a list of arrays with their corresponding management servers

func (*StandAloneProxyConfig) GetManagementServers

func (proxy *StandAloneProxyConfig) GetManagementServers() []ManagementServer

GetManagementServers - Returns the list of management servers present in StandAloneProxyConfig

func (*StandAloneProxyConfig) GetStorageArray

func (proxy *StandAloneProxyConfig) GetStorageArray(storageArrayID string) []StorageArray

GetStorageArray - Returns a list of storage array given a storage array id

type StorageArray

type StorageArray struct {
	StorageArrayIdentifier string
	PrimaryURL             url.URL
	SecondaryURL           url.URL
	ProxyCredentialSecrets map[string]ProxyCredentialSecret
}

StorageArray represents a StorageArray (formed using StorageArrayConfig)

type StorageArrayConfig

type StorageArrayConfig struct {
	StorageArrayID         string   `yaml:"storageArrayId"`
	PrimaryURL             string   `yaml:"primaryURL"`
	BackupURL              string   `yaml:"backupURL,omitempty"`
	ProxyCredentialSecrets []string `yaml:"proxyCredentialSecrets"`
}

StorageArrayConfig represents the configuration of a storage array in the config file

type StorageArrayServer

type StorageArrayServer struct {
	Array         StorageArray
	PrimaryServer ManagementServer
	BackupServer  *ManagementServer
}

StorageArrayServer represents an array with its primary and backup management server

Jump to

Keyboard shortcuts

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