config

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AreasCollection = "AreasCollection"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr                   string        `envconfig:"BIND_ADDR"`
	GracefulShutdownTimeout    time.Duration `envconfig:"GRACEFUL_SHUTDOWN_TIMEOUT"`
	HealthCheckInterval        time.Duration `envconfig:"HEALTHCHECK_INTERVAL"`
	HealthCheckCriticalTimeout time.Duration `envconfig:"HEALTHCHECK_CRITICAL_TIMEOUT"`
	RDSDBName                  string        `envconfig:"DBNAME"`
	RDSDBUser                  string        `envconfig:"DBUSER"`
	RDSDBHost                  string        `envconfig:"DBHOST"`
	RDSDBPort                  string        `envconfig:"DBPORT"`
	AWSRegion                  string        `envconfig:"AWSREGION"`
	RDSDBConnectionTTL         time.Duration `envconfig:"RDSCONNECTIONTTL"`
	RDSDBMaxConnections        int           `envconfig:"RDSMAXCONNECTIONS"`
	RDSDBMinConnections        int           `envconfig:"RDSMINCONNECTIONS"`
	// flag to use local postres instace provided by dp-compose
	DPPostgresLocal        bool   `envconfig:"USEPOSTGRESLOCAL"`
	DPPostgresUserName     string `envconfig:"DPPOSTGRESUSERNAME"`
	DPPostgresUserPassword string `envconfig:"DPPOSTGRESPASSWORD"`
	DPPostgresLocalPort    string `envconfig:"DPPOSTGRESPORT"`
	DPPostgresLocalDB      string `envconfig:"USEPOSTGRESDB"`

	EnablePrivateEndpoints bool   `envconfig:"ENABLE_PRIVATE_ENDPOINTS"`
	S3Bucket               string `envconfig:"S3_BUCKET"`
	AWSAccessKey           string `envconfig:"AWS_ACCESS_KEY_ID"`
	AWSSecretKey           string `envconfig:"AWS_SECRET_ACCESS_KEY"`
}

Config represents service configuration for dp-areas-api

func Get

func Get() (*Config, error)

Get returns the default config with any modifications through environment variables

func (Config) GetDBEndpoint added in v0.9.0

func (c Config) GetDBEndpoint() string

GetDBEndpoint get sql endpoint

func (Config) GetLocalDBConnectionString added in v0.9.0

func (c Config) GetLocalDBConnectionString() string

GetLocalDBConnectionString returns local connection string

func (Config) GetRDSEndpoint added in v0.10.0

func (c Config) GetRDSEndpoint() string

func (Config) GetRemoteDBConnectionString added in v0.9.0

func (c Config) GetRemoteDBConnectionString(authToken string) string

GetRemoteDBConnectionString returns remote connection string

Jump to

Keyboard shortcuts

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