config

package
v0.0.0-...-4c45443 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvConfig

type EnvConfig struct {
	ServerName string `envconfig:"SERVER_NAME" required:"true"`
	ServerPort int    `envconfig:"SERVER_PORT" default:"7010" required:"true"`

	PostgresDbURI             string        `envconfig:"POSTGRES_DB_URI" required:"true"`
	PostgresMaxIdleConnection int           `envconfig:"POSTGRES_MAX_IDLE_CONNECTION" default:"10"`
	PostgresMaxOpenConnection int           `envconfig:"POSTGRES_MAX_OPEN_CONNECTION" default:"10"`
	PostgresConnMaxLifetime   time.Duration `envconfig:"POSTGRES_CONNECTION_MAX_LIFE_TIME" default:"60s"`
	PostgresLogMode           bool          `envconfig:"POSTGRES_LOG_MODE" default:"false"`
	PostgresLogColorful       bool          `envconfig:"POSTGRES_LOG_COLORFUL" default:"false"`

	JwtPrivateKey        string        `envconfig:"JWT_PRIVATE_KEY" required:"true"`
	JwtPublicKey         string        `envconfig:"JWT_PUBLIC_KEY" required:"true"`
	JwtExpiresInDuration time.Duration `envconfig:"JWT_EXPIRES_IN_DURATION" default:"5d" required:"true"`
}

func NewConfig

func NewConfig() (*EnvConfig, error)

Jump to

Keyboard shortcuts

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