env

package
v0.0.0-...-45d9d46 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Overview

Package env provides a type for runtime environments.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAllowed = errors.New("action not allowed for the environment")

ErrNotAllowed describes an error for action which is not allowed in a given environment.

Functions

This section is empty.

Types

type Environment

type Environment string

Environment defines a runtime environment.

const (
	Local       Environment = "local"
	Test        Environment = "test"
	Development Environment = "dev"
	Qa          Environment = "qa"
	Staging     Environment = "staging"
	Production  Environment = "prod"
)

Available commonly used environments.

func Parse

func Parse(envName string) (Environment, error)

Parse returns an environment constant from a given string representation of it.

func (Environment) Validate

func (env Environment) Validate() error

Validate checks that the environment value is valid.

Jump to

Keyboard shortcuts

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