config

package
v0.0.0-...-dc0472d Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort       = "8080"
	DefaultLogLevel   = "info"
	DefDatabase       = "ecommerce"
	DefEnvironment    = "local"
	DefDBQueryLogging = false
	DefEnableTracing  = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceEnvConfig

type ServiceEnvConfig struct {
	Environment string // environment where this service is running (dev, staging, prod, etc.)
	Port        string // port on which this service runs, defaults to DefaultPort
	LogLevel    string // logger level for the service

	// DB related configurations
	DBCredentialsSideCar string // path to find the database credentials sidecar file
	DBHosts              string // comma separated list of DB hosts
	DBName               string // name of the database
	DBPort               int    // port on which the DB is listening, defaults to 27017
	DBLogQueries         bool   // print the DB queries that are triggered through this service, defaults to false

	DisableAuth   bool // disables API authentication, added to make local development/testing easy
	EnableTracing bool // enables flight recorder for slow request tracing, defaults to false
}

ServiceEnvConfig holds all environmental configurations for the service.

func Load

func Load() (*ServiceEnvConfig, error)

Load reads all environmental configurations and returns a ServiceEnvConfig.

Jump to

Keyboard shortcuts

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