config

package
v0.0.0-...-6290bb2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALERT_CHANNELS = "ALERT_CHANNELS"
View Source
var ALERT_HTTP string = "http"

ALERT CHANNELS

View Source
var APP_NAME string = "APP_NAME"
View Source
var AVAILABLE_CHANNELS = []string{ALERT_HTTP}
View Source
var CA_CERT_FILE string = "/ca-cert.pem"

SSL File Names

View Source
var CLIENT_CERT_FILE string = "/client-cert.pem"
View Source
var CLIENT_KEY_FILE string = "/client-key.pem"
View Source
var DB_HOST string = "DB_HOST"
View Source
var DB_NAME string = "DB_NAME"
View Source
var DB_PASS string = "DB_PASS"
View Source
var DB_PORT string = "DB_PORT"
View Source
var DB_PROTOCOL string = "DB_PROTOCOL"
View Source
var DB_SSLMode string = "DB_SSLMode"

EnvNames

View Source
var DB_SSL_PASS string = "DB_SSL_PASS"
View Source
var DB_USER string = "DB_USER"
View Source
var DISABLE_SSL = "disable"

SSL Modes

View Source
var MAX_JOBS string = "MAX_JOBS"
View Source
var POLL_INTERVAL_SECONDS string = "POLL_INTERVAL_SECONDS"
View Source
var ProdRuokEnvironment = "production"

PROD_ENVIRONMENT

View Source
var REQUIRE_SSL = "require"
View Source
var RUOK_ENVIRONMENT = "RUOK_ENVIRONMENT"
View Source
var STORAGE_KIND string = "STORAGE_KIND"

Functions

func AlertChannels

func AlertChannels() []string

func AppName

func AppName() string

func MaxJobs

func MaxJobs() int

func ParsePollInterval

func ParsePollInterval() time.Duration

func PollingInterval

func PollingInterval() time.Duration

Types

type Configs

type Configs struct {
	Kind          string
	Protocol      string
	Pass          string
	User          string
	Host          string
	Port          string
	Dbname        string
	SSLConfigs    SSLConfig
	AppName       string
	MaxJobs       int
	PollInterval  time.Duration
	StartedAt     int64
	AlertChannels []string
}

func FromEnvs

func FromEnvs() Configs

type SSLConfig

type SSLConfig struct {
	SSLMode     string
	CACertPath  string
	SSLCertPath string
	SSLKeyPath  string
	SSLPassword string
}

type Stats

type Stats struct {
	ClaimedJobs int
	StartedAt   int64
}
var AppStats *Stats = &Stats{
	StartedAt: time.Now().UnixMicro(),
}

func (*Stats) CountClaimedJobs

func (s *Stats) CountClaimedJobs() int

func (*Stats) Uptime

func (s *Stats) Uptime() int64

Jump to

Keyboard shortcuts

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