config

package
v0.0.0-...-015189f Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const COMPONENT_VERSION = "2.11.0"

Variables

View Source
var Cfg = new()
View Source
var DEVELOPMENT_MODE = false // Do not change this. See config_development.go to enable.

Functions

func GetDynamicClient

func GetDynamicClient() dynamic.Interface

Get the kubernetes dynamic client.

Types

type Config

type Config struct {
	DBBatchSize         int // Batch size used to write to DB. Default: 500
	DBHealthCkeckPeriod int // Overrides pgxpool.Config{ HealthCheckPeriod } Default: 1 min
	DBHost              string
	DBMinConns          int // Overrides pgxpool.Config{ MinConns } Default: 0
	DBMaxConns          int // Overrides pgxpool.Config{ MaxConns } Default: 20
	DBMaxConnIdleTime   int // Overrides pgxpool.Config{ MaxConnIdleTime } Default: 30 min
	DBMaxConnLifeTime   int // Overrides pgxpool.Config{ MaxConnLifetime } Default: 60 min
	DBMaxConnLifeJitter int // Overrides pgxpool.Config{ MaxConnLifetimeJitter } Default: 2 min
	DBName              string
	DBPass              string
	DBPort              int
	DBUser              string
	DevelopmentMode     bool
	HTTPTimeout         int // Timeout for http server connections. Default: 5 min
	KubeClient          *kubernetes.Clientset
	KubeConfigPath      string
	MaxBackoffMS        int // Maximum backoff in ms to wait after db connection error
	PodName             string
	PodNamespace        string
	ResyncPeriodMS      int    // Time in MS for the clusters informer. Default: 15 min.
	RediscoverRateMS    int    // Time in MS we should check on cluster resource type
	RequestLimit        int    // Max number of concurrent requests. Used to prevent from overloading the database
	ServerAddress       string // Web server address
	SlowLog             int    // Log operations slower than the specified time in ms. Default: 1 sec
	Version             string
}

Struct to hold our configuratioin

func (*Config) PrintConfig

func (cfg *Config) PrintConfig()

Format and print environment to logger.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate required configuration.

Jump to

Keyboard shortcuts

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