Line
Represents a KEY=VALUE
pair in a dotenv file.
struct Line
Represents a KEY=VALUE
pair in a dotenv file.
struct Line
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct DotEnvFile
Reads dotenv (.env
) files and loads them into the current process.
static func load(for environment: Environment = .development, fileio: NonBlockingFileIO, logger: Logger = Logger(label: "dot-env-loggger")) async
Reads the dotenv files relevant to the environment and loads them into the process.
static func load(path: String, fileio: NonBlockingFileIO, logger: Logger = Logger(label: "dot-env-loggger")) async
Reads the dotenv files relevant to the environment and loads them into the process.
static func load(path: String, fileio: NonBlockingFileIO, overwrite: Bool = false) async throws
Reads a dotenv file from the supplied path and loads it into the process.
static func read(path: String, fileio: NonBlockingFileIO) async throws -> DotEnvFile
Reads a dotenv file from the supplied path.
let lines: [Line]
All KEY=VALUE
pairs found in the file.
func load(overwrite: Bool = false)
Loads this file’s KEY=VALUE
pairs into the current process.
static func load(for environment: Environment = .development, on eventLoopGroupProvider: Application.EventLoopGroupProvider = .singleton, fileio: NonBlockingFileIO, logger: Logger = Logger(label: "dot-env-logger"))
Reads the dotenv files relevant to the environment and loads them into the process.
static func load(for environment: Environment = .development, on eventLoopGroupProvider: Application.EventLoopGroupProvider = .singleton, logger: Logger = Logger(label: "dot-env-logger"))
Reads the dotenv files relevant to the environment and loads them into the process.
static func load(path: String, fileio: NonBlockingFileIO, on eventLoop: EventLoop, overwrite: Bool = false) -> EventLoopFuture<Void>
Reads a dotenv file from the supplied path and loads it into the process.
static func load(path: String, on eventLoopGroupProvider: Application.EventLoopGroupProvider = .singleton, fileio: NonBlockingFileIO, logger: Logger = Logger(label: "dot-env-logger"))
Reads the dotenv files relevant to the environment and loads them into the process.
static func load(path: String, on eventLoopGroupProvider: Application.EventLoopGroupProvider = .singleton, logger: Logger = Logger(label: "dot-env-logger"))
Reads the dotenv files relevant to the environment and loads them into the process.
static func read(path: String, fileio: NonBlockingFileIO, on eventLoop: EventLoop) -> EventLoopFuture<DotEnvFile>
Reads a dotenv file from the supplied path.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Sendable
var description: String { get }
CustomStringConvertible
conformance.
let key: String
The key.
let value: String
The value.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.