config

package
v1.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.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"`
	DefaultTheme            string        `mapstructure:"DEFAULT_THEME" yaml:"defaultTheme" default:"hacker-terminal"`
	DefaultRefreshFrequency time.Duration `mapstructure:"DEFAULT_REFRESH_FREQUENCY" yaml:"defaultRefreshFrequency" default:"5s"`
}

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"`
}

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:"expirationIntrerval" 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