config

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Environment        string `env:"ENVIRONMENT,required"`
	LogLevel           string `env:"LOG_LEVEL,default=INFO"`
	Port               string `env:"PORT,default=8000"`
	P2pNetwork         string `env:"P2P_NETWORK,required"`
	MongoURI           string `env:"MONGODB_URI,required"`
	MongoDatabase      string `env:"MONGODB_DATABASE,required"`
	AwsEndpoint        string `env:"AWS_ENDPOINT"`
	AwsAccessKeyID     string `env:"AWS_ACCESS_KEY_ID"`
	AwsSecretAccessKey string `env:"AWS_SECRET_ACCESS_KEY"`
	AwsRegion          string `env:"AWS_REGION"`
	SNSUrl             string `env:"SNS_URL"`
	PprofEnabled       bool   `env:"PPROF_ENABLED,default=false"`
	AlertEnabled       bool   `env:"ALERT_ENABLED,default=false"`
	AlertApiKey        string `env:"ALERT_API_KEY"`
	MetricsEnabled     bool   `env:"METRICS_ENABLED,default=false"`
}

Configuration represents the application configuration with the default values.

func New

func New(ctx context.Context) (*Configuration, error)

New creates a configuration with the values from .env file and environment variables.

Jump to

Keyboard shortcuts

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