config

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProviders

func GetProviders() []string

Types

type BlockingStrategy

type BlockingStrategy struct {
	DefaultTimeout time.Duration `mapstructure:"DEFAULT_TIMEOUT" yaml:"defaultTimeout" default:"1m"`
}

type Config

type Config struct {
	Server   Server
	Storage  Storage
	Provider Provider
	Sessions Sessions
	Logging  Logging
	Strategy Strategy
}

func NewConfig

func NewConfig() Config

type DynamicStrategy

type DynamicStrategy struct {
	CustomThemesPath        string        `mapstructure:"CUSTOM_THEMES_PATH" yaml:"customThemesPath"`
	ShowDetailsByDefault    bool          `mapstructure:"SHOW_DETAILS_BY_DEFAULT" yaml:"showDetailsByDefault"`
	DefaultTheme            string        `mapstructure:"DEFAULT_THEME" yaml:"defaultTheme" default:"hacker-terminal"`
	DefaultRefreshFrequency time.Duration `mapstructure:"DEFAULT_REFRESH_FREQUENCY" yaml:"defaultRefreshFrequency" default:"5s"`
}

type Kubernetes added in v1.6.0

type Kubernetes struct {
	//QPS limit for  K8S API access client-side throttle
	QPS float32 `mapstructure:"QPS" yaml:"QPS" default:"5"`
	//Maximum burst for client-side throttle
	Burst int `mapstructure:"BURST" yaml:"Burst" default:"10"`
}

type Logging

type Logging struct {
	Level string `mapstructure:"LEVEL" yaml:"level" default:"info"`
}

func NewLoggingConfig

func NewLoggingConfig() Logging

type Provider

type Provider struct {
	Name       string `mapstructure:"NAME" yaml:"provider,omitempty"`
	Kubernetes Kubernetes
}

Provider holds the provider description It can be either docker, swarm or kubernetes

func NewProviderConfig

func NewProviderConfig() Provider

func (Provider) IsValid

func (provider Provider) IsValid() error

type Server

type Server struct {
	Port     int    `mapstructure:"PORT" yaml:"port" default:"10000"`
	BasePath string `mapstructure:"BASE_PATH" yaml:"basePath" default:"/"`
}

func NewServerConfig

func NewServerConfig() Server

type Sessions

type Sessions struct {
	DefaultDuration    time.Duration `mapstructure:"DEFAULT_DURATION" yaml:"defaultDuration" default:"5m"`
	ExpirationInterval time.Duration `mapstructure:"EXPIRATION_INTERVAL" yaml:"expirationInterval" default:"20s"`
}

func NewSessionsConfig

func NewSessionsConfig() Sessions

type Storage

type Storage struct {
	File string `mapstructure:"FILE" yaml:"file" default:""`
}

func NewStorageConfig

func NewStorageConfig() Storage

type Strategy

type Strategy struct {
	Dynamic  DynamicStrategy
	Blocking BlockingStrategy
}

func NewStrategyConfig

func NewStrategyConfig() Strategy

Jump to

Keyboard shortcuts

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