config

package
v0.0.0-...-ffaedda Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Health HealthConfig `envconfig:"HEALTH"`
	Stream StreamConfig `envconfig:"STREAM"`
}

Config represents service configurations.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig returns parsed from environment variables service configuration.

type HealthConfig

type HealthConfig struct {
	Port          int           `envconfig:"PORT" default:"6061"`
	LiveEndpoint  string        `envconfig:"LIVINESS_ENDPOINT" default:"/livez"`
	ReadyEndpoint string        `envconfig:"READINESS_ENDPOINT" default:"/ready"`
	Period        time.Duration `envconfig:"PERIOD" default:"3s"`
	GracePeriod   time.Duration `envconfig:"GRACE_PERIOD" default:"30s"`
}

HealthConfig represents health controller configuration.

type StreamConfig

type StreamConfig struct {
	Host string `envconfig:"HOST"`
	Port int    `envconfig:"PORT" default:"6379"`
}

StreamConfig represents stream connection configuration.

func (StreamConfig) Addr

func (c StreamConfig) Addr() string

Jump to

Keyboard shortcuts

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