config

package
v2.4.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppEnvDevelopment - development environment
	AppEnvDevelopment = "development"
	// AppEnvTest - test environment
	AppEnvTest = "test"
	// AppEnvProduction - production environment
	AppEnvProduction = "production"
)

Variables

View Source
var (
	// GitCommit is the current git commit hash
	GitCommit string

	// Version is the app version
	Version string
)
View Source
var (
	// AppEnv - application environment (development/test/production)
	AppEnv = getEnv("APP_ENV", "development")

	// Port - port to listen on
	Port, _ = strconv.ParseUint(getEnv("PORT", "8080"), 10, 16)

	// ServerURL - url of the server
	ServerURL = getEnv("SERVER_URL", "")

	// PostgresURL - postgreSQL server url
	PostgresURL = getEnv("DATABASE_URL", "")

	// AllowedOrigins - allowed RPC origins, space separated
	AllowedOrigins = func() util.StringSet {
		allowedOrigins := getEnv("ALLOWED_ORIGINS", "")
		if len(allowedOrigins) == 0 {
			return util.NewStringSet()
		}
		return util.StringSetFromStringSlice(strings.Split(allowedOrigins, " "))
	}()

	// ForceSSL - enforce HTTPS
	ForceSSL, _ = strconv.ParseBool(getEnv("FORCE_SSL", "false"))

	// ReadDeadline - Deadline for reading messages
	ReadDeadline time.Duration
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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