Environment
public struct Environment
extension Environment: Equatable
Manages an application’s Environment such as .production, .development, and .testing. Enables to create a custom Environment
and provides access to Environment variables.
-
The name of an
Environment.Declaration
Swift
public let name: String -
Initializes a new instance of
Environmentwith a name.Declaration
Swift
public init(name: String = Environment.get("CHAQMOQ_ENV") ?? "")Parameters
nameThe name for a new
Environment. Defaults to theEnvironmentvariable with theCHAQMOQ_ENVkey or falls back to thedevelopmentEnvironmentif it doesn’t exist or the provided name is empty. -
Gets an
Environmentvariable by key.Declaration
Swift
public static func get(_ key: String) -> String?Parameters
keyA key for an
Environmentvariable.Return Value
An
Environmentvariable if it exists ornilif it doesn’t. -
An
Environmentfor deploying an application.Declaration
Swift
public static let production: Environment -
An
Environmentfor developing an application.Declaration
Swift
public static let development: Environment -
An
Environmentfor testing an application.Declaration
Swift
public static let testing: Environment -
See
Equatable.Declaration
Swift
public static func == (lhs: Environment, rhs: Environment) -> Bool
View on GitHub
Install in Dash
Environment Structure Reference