local_config

package
v0.0.0-...-8aaea72 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorLogFilePath = filepath.Join(LogDirectoryPath, "swiftwave.error.log")
View Source
var InfoLogFilePath = filepath.Join(LogDirectoryPath, "swiftwave.log")
View Source
var LocalConfigPath = filepath.Join(defaultDataDirectory, "config.yml")
View Source
var LogDirectoryPath = "/var/log/swiftwave"

Functions

func FillDefaults

func FillDefaults(config *Config) error

func Update

func Update(config *Config) error

Types

type Config

type Config struct {
	IsDevelopmentMode              bool                           `yaml:"dev_mode"`
	Version                        string                         `yaml:"-"`
	ServiceConfig                  ServiceConfig                  `yaml:"service"`
	PostgresqlConfig               PostgresqlConfig               `yaml:"postgresql"`
	LocalImageRegistryConfig       LocalImageRegistryConfig       `yaml:"local_image_registry"`
	EnvironmentVariables           EnvironmentVariables           `yaml:"environment_variables"`
	ManagementNodeTunnellingConfig ManagementNodeTunnellingConfig `yaml:"management_node_tunnelling"`
}

func Fetch

func Fetch() (*Config, error)

func (*Config) DeepCopy

func (config *Config) DeepCopy() *Config

func (*Config) GetRegistryURL

func (config *Config) GetRegistryURL() string

func (*Config) LocalImageRegistryNodeAddressConsideringTunnelling

func (config *Config) LocalImageRegistryNodeAddressConsideringTunnelling() string

func (*Config) LocalImageRegistryNodePortConsideringTunnelling

func (config *Config) LocalImageRegistryNodePortConsideringTunnelling() int

func (*Config) ManagementNodeAddressConsideringTunnelling

func (config *Config) ManagementNodeAddressConsideringTunnelling() string

func (*Config) ManagementNodePortConsideringTunnelling

func (config *Config) ManagementNodePortConsideringTunnelling() int

func (*Config) String

func (config *Config) String() (string, error)

type EnvironmentVariables

type EnvironmentVariables struct {
	SshAuthSock   string `yaml:"SSH_AUTH_SOCK"`
	SshKnownHosts string `yaml:"SSH_KNOWN_HOSTS"`
}

type LocalImageRegistryConfig

type LocalImageRegistryConfig struct {
	// TLS of this depends on the TLS status of the service
	// both will use same certificate
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Image    string `yaml:"image"`
	DataPath string `yaml:"-"`
	CertPath string `yaml:"-"`
	AuthPath string `yaml:"-"`
}

func (*LocalImageRegistryConfig) Htpasswd

func (l *LocalImageRegistryConfig) Htpasswd() (string, error)

type ManagementNodeTunnellingConfig

type ManagementNodeTunnellingConfig struct {
	Enabled                       bool   `yaml:"enabled"`
	ManagementNodeAddress         string `yaml:"management_node_address"`
	ManagementNodePort            int    `yaml:"management_node_port"`
	LocalImageRegistryNodeAddress string `yaml:"local_image_registry_node_address"`
	LocalImageRegistryNodePort    int    `yaml:"local_image_registry_node_port"`
}

type PostgresqlConfig

type PostgresqlConfig struct {
	Host             string `yaml:"host"`
	Port             int    `yaml:"port"`
	User             string `yaml:"user"`
	Password         string `yaml:"password"`
	Database         string `yaml:"database"`
	TimeZone         string `yaml:"time_zone"`
	SSLMode          string `yaml:"ssl_mode"`
	RunLocalPostgres bool   `yaml:"run_local_postgres"`
}

func (PostgresqlConfig) DSN

func (p PostgresqlConfig) DSN() string

type ServiceConfig

type ServiceConfig struct {
	UseTLS                          bool   `yaml:"use_tls"`
	ManagementNodeAddress           string `yaml:"management_node_address"`
	AutoRenewManagementNodeCert     bool   `yaml:"auto_renew_management_node_cert"`
	BindAddress                     string `yaml:"bind_address"`
	BindPort                        int    `yaml:"bind_port"`
	SSHTimeout                      int    `yaml:"ssh_timeout"`
	SocketPathDirectory             string `yaml:"-"`
	DataDirectory                   string `yaml:"-"`
	LocalPostgresDataDirectory      string `yaml:"-"`
	TarballDirectoryPath            string `yaml:"-"`
	PVBackupDirectoryPath           string `yaml:"-"`
	PVRestoreDirectoryPath          string `yaml:"-"`
	NetworkName                     string `yaml:"-"`
	HAProxyServiceName              string `yaml:"-"`
	HAProxyUnixSocketDirectory      string `yaml:"-"`
	HAProxyUnixSocketPath           string `yaml:"-"`
	HAProxyDataDirectoryPath        string `yaml:"-"`
	UDPProxyServiceName             string `yaml:"-"`
	UDPProxyUnixSocketDirectory     string `yaml:"-"`
	UDPProxyUnixSocketPath          string `yaml:"-"`
	UDPProxyDataDirectoryPath       string `yaml:"-"`
	SSLCertDirectoryPath            string `yaml:"-"`
	LocalImageRegistryDirectoryPath string `yaml:"-"`
	LogDirectoryPath                string `yaml:"-"`
	InfoLogFilePath                 string `yaml:"-"`
	ErrorLogFilePath                string `yaml:"-"`
}

Jump to

Keyboard shortcuts

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