serverconfig

package
v0.0.0-...-642d756 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package serverconfig resolves shared configuration for Go Discovery services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key, fallback string) string

GetEnv looks up the given key from the environment, returning its value if it exists, and otherwise returning the given fallback value.

func GetEnvInt

func GetEnvInt(ctx context.Context, key string, fallback int) int

GetEnvInt looks up the given key from the environment and expects an integer, returning the integer value if it exists, and otherwise returning the given fallback value. If the environment variable has a value but it can't be parsed as an integer, GetEnvInt terminates the program.

func Init

func Init(ctx context.Context) (_ *config.Config, err error)

Init resolves all configuration values provided by the config package. It must be called before any configuration values are used.

func OnAppEngine

func OnAppEngine() bool

OnAppEngine reports if the current process is running in an AppEngine environment.

func OnGCP

func OnGCP() bool

OnGCP reports whether the current process is running on Google Cloud Platform.

func OnGKE

func OnGKE() bool

OnGKE reports whether the current process is running on GKE.

func ValidateAppVersion

func ValidateAppVersion(appVersion string) error

ValidateAppVersion validates that appVersion follows the expected format defined by AppVersionFormat.

Types

This section is empty.

Jump to

Keyboard shortcuts

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