settings

package
v0.2.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 13

Documentation

Index

Constants

View Source
const BackupTargetSettingName = "backup-target"

Variables

View Source
var (
	InjectDefaults string

	APIUIVersion           = NewSetting("api-ui-version", "1.1.9") // Please update the HARVESTER_API_UI_VERSION in package/Dockerfile when updating the version here.
	AuthenticationMode     = NewSetting("authentication-mode", fmt.Sprintf("%s,%s", harvesterv1.KubernetesCredentials, harvesterv1.LocalUser))
	AuthSecretName         = NewSetting("auth-secret-name", "harvester-key-holder")
	AuthTokenMaxTTLMinutes = NewSetting("auth-token-max-ttl-minutes", "720")
	FirstLogin             = NewSetting("first-login", "true")
	NoDefaultAdmin         = NewSetting("no-default-admin", "")
	ServerURL              = NewSetting("server-url", "")
	ServerVersion          = NewSetting("server-version", "dev")
	UIIndex                = NewSetting("ui-index", "https://releases.rancher.com/harvester-ui/latest/index.html")
	UIPath                 = NewSetting("ui-path", "/usr/share/harvester/harvester")
	APIUISource            = NewSetting("api-ui-source", "auto") // Options are 'auto', 'external' or 'bundled'
	VolumeSnapshotClass    = NewSetting("volume-snapshot-class", "longhorn")
	BackupTargetSet        = NewSetting(BackupTargetSettingName, InitBackupTargetToString())
	RancherEnabled         = NewSetting("rancher-enabled", "false") // Specify whether the UI should display the Rancher UI navigation
	UpgradableVersions     = NewSetting("upgradable-versions", "")
	VersionMetadataURL     = NewSetting("version-metadata-url", "")
	LogLevel               = NewSetting("log-level", "info") // options are info, debug and trace
)

Functions

func GetEnvKey

func GetEnvKey(key string) string

func InitBackupTargetToString

func InitBackupTargetToString() string

func IsRelease

func IsRelease() bool

func SetProvider

func SetProvider(p Provider) error

Types

type BackupTarget

type BackupTarget struct {
	Type               TargetType `json:"type"`
	Endpoint           string     `json:"endpoint"`
	AccessKeyID        string     `json:"accessKeyId"`
	SecretAccessKey    string     `json:"secretAccessKey"`
	BucketName         string     `json:"bucketName"`
	BucketRegion       string     `json:"bucketRegion"`
	Cert               string     `json:"cert"`
	VirtualHostedStyle bool       `json:"virtualHostedStyle"`
}

type Provider

type Provider interface {
	Get(name string) string
	Set(name, value string) error
	SetIfUnset(name, value string) error
	SetAll(settings map[string]Setting) error
}

type Setting

type Setting struct {
	Name     string
	Default  string
	ReadOnly bool
}

func NewSetting

func NewSetting(name, def string) Setting

func (Setting) Get

func (s Setting) Get() string

func (Setting) GetInt

func (s Setting) GetInt() int

func (Setting) Set

func (s Setting) Set(value string) error

func (Setting) SetIfUnset

func (s Setting) SetIfUnset(value string) error

type TargetType

type TargetType string
const (
	S3BackupType  TargetType = "s3"
	NFSBackupType TargetType = "nfs"
)

Jump to

Keyboard shortcuts

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