env

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env           environment `mapstructure:"ENV"`
	Debug         bool        `mapstructure:"DEBUG"`
	Port          int         `mapstructure:"PORT"`
	SecretKey     string      `mapstructure:"SECRET_KEY"`
	EncryptionKey string      `mapstructure:"ENCRYPTION_KEY"`
	DatabaseURL   string      `mapstructure:"DATABASE_URL"`
	RedisURL      string      `mapstructure:"REDIS_URL"`
}

Config represents the environment configuration.

func Load

func Load() (*Config, error)

Load loads and returns the env.Config struct.

func MustLoad

func MustLoad() *Config

MustLoad ensures that a new env.Config struct is loaded and panics if not.

func (*Config) IsDevelopment

func (c *Config) IsDevelopment() bool

IsDevelopment returns whether Config represents a development environment.

func (*Config) IsProduction

func (c *Config) IsProduction() bool

IsProduction returns whether Config represents a production environment.

Jump to

Keyboard shortcuts

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