Classes
- Application
-
Core type representing a Vapor application.
- Application.Locks
- BCryptDigest
-
Creates and verifies BCrypt hashes. Normally you will not need to initialize one of these classes and you will use the global
BCrypt
convenience instead. - BootCommand
-
Boots the
Application
then exits successfully. - RoutesCommand
-
Displays all routes registered to the
Application
'sRouter
in an ASCII-formatted table. - ServeCommand
-
Boots the application's server. Listens for
SIGINT
andSIGTERM
for graceful shutdown. - EndpointCache
-
Handles the complexities of HTTP caching.
- HTTPServer
- CORSMiddleware
-
Middleware that adds support for CORS settings in request responses. For configuration of this middleware please use the
CORSMiddleware.Configuration
object. - ErrorMiddleware
-
Captures all errors and transforms them into an internal server error HTTP response.
- FileMiddleware
-
Serves static files from a public directory.
- RouteLoggingMiddleware
-
Emits a log message containing the request method and path to a
Request
's logger. The log level of the message is configurable. - Request
-
Represents an HTTP request in an application.
- Response
-
An HTTP response from a server back to the client.
- Route
- Routes
- MemorySessions.Storage
- Session
-
Sessions are a method for associating data with a client accessing your app.
- SessionsMiddleware
-
Uses HTTP cookies to save and restore sessions for connecting clients.
Structures
- Application.Lifecycle
- Request.Authentication
-
Request helper for storing and fetching authenticated objects.
- BasicAuthorization
-
A basic username and password.
- BearerAuthorization
-
A bearer token.
- Application.Caches
- Application.Caches.Provider
- Application.Clients
- Application.Clients.Provider
- ClientRequest
- ClientResponse
- BootCommand.Signature
-
See
Command
. - RoutesCommand.Signature
- ServeCommand.Signature
- AnyAsyncResponse
-
A type erased response useful for routes that can return more than one type.
- AsyncBasicResponder
-
A basic, async closure-based
Responder
. - ContentConfiguration
-
Configures which
Encoder
s andDecoder
s to use when interacting with data in HTTP messages. - PlaintextDecoder
-
Decodes data as plaintext, utf8.
- PlaintextEncoder
-
Encodes data as plaintext, utf8.
- Application.Core
- Application.Running
- Environment.Process
-
The process information of an environment. Wraps
ProcessInto.processInfo
. - Environment
-
The environment the application is running in, i.e., production, dev, etc. All
Container
s will have anEnvironment
that can be used to dynamically register and configure services. - Abort
-
Default implementation of
AbortError
. You can use this as a convenient method for throwingAbortError
s without having to conform your own error-type toAbortError
. - ErrorSource
-
A source-code location.
- StackTrace
- StackTrace.Frame
- Application.HTTP
- BasicResponder
-
A basic, closure-based
Responder
. - Application.HTTP.Client
- HTTPCookies
-
A collection of
HTTPCookie
s. - HTTPCookies.Value
-
A single cookie (key/value pair).
- HTTPHeaders.CacheControl
-
Represents the HTTP
Cache-Control
header. - HTTPHeaders.CacheControl.MaxStale
-
The max-stale option can be present with no value, or be present with a number of seconds. By using a struct you can check the nullability of the
maxStale
variable as well as then check the nullability of theseconds
to differentiate. - HTTPHeaders.Expires
- HTTPHeaders.LastModified
-
Represents the HTTP
Last-Modified
header. - HTTPHeaders.Connection
- HTTPHeaders.ContentDisposition
- HTTPHeaders.ContentDisposition.Value
- HTTPHeaders.Range
-
Represents the HTTP
Range
request header. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range - HTTPHeaders.ContentRange
-
Represents the HTTP
Content-Range
response header. - HTTPHeaders.Forwarded
-
Parses the
Forwarded
header. - HTTPHeaders.Link
- HTTPHeaders.Link.Relation
-
See https://www.iana.org/assignments/link-relations/link-relations.xhtml
- HTTPHeaders.Name
-
Type used for the name of a HTTP header in the
HTTPHeaders
storage. - HTTPMediaType
-
Represents an encoded data-format, used in HTTP, HTML, email, and elsewhere.
- HTTPMediaTypePreference
-
Represents a
MediaType
and its associated preference,q
. - Application.HTTP.Server
- HTTPServer.Configuration
-
Engine server config struct.
- HTTPServer.Configuration.CompressionConfiguration
-
Supported HTTP compression options.
- HTTPServer.Configuration.DecompressionConfiguration
-
Supported HTTP decompression options.
- WebSocketUpgrader
-
Handles upgrading an HTTP connection to a WebSocket
- CORSMiddleware.Configuration
-
Configuration used for populating headers in response for CORS requests.
- Middlewares
-
Configures an application's active
Middleware
. Middleware will be used in the order they are added. - Application.Password
- Application.Passwords
- Application.Passwords.Provider
- AsyncPasswordHasher
- Request.Password
- Request.Body
- Application.Responder
- Application.Responder.Provider
- Response.Body
-
Represents a
Response
's body. - WebSocketMaxFrameSize
- HOTP
-
Create a one-time password using hash-based message authentication codes.
- TOTP
-
Create a one-time password using hash-based message authentication codes and taking uniqueness from the time.
- Application.Servers
- Application.Servers.Provider
- Application.Sessions
- Application.Sessions.Provider
- MemorySessions
-
Simple in-memory sessions implementation.
- SessionID
- SessionData
-
A container for storing data associated with a given
SessionID
. - SessionsConfiguration
-
Configuration options for sessions.
- URLEncodedFormDecoder
-
Decodes instances of
Decodable
types fromapplication/x-www-form-urlencoded
Data
. - URLEncodedFormDecoder.Configuration
-
Used to capture URLForm Coding Configuration used for decoding
- URLEncodedFormEncoder
-
Encodes
Encodable
instances toapplication/x-www-form-urlencoded
data. - URLEncodedFormEncoder.Configuration
-
Used to capture URLForm Coding Configuration used for encoding.
- AnyResponse
-
A type erased response useful for routes that can return more than one type.
- BaseNEncoding
- ByteCount
-
Represents a number of bytes:
- DecoderUnwrapper
- DirectoryConfiguration
-
DirectoryConfiguration
represents a configured working directory. It can also be used to derive a working directory automatically. - DotEnvFile
-
Reads dotenv (
.env
) files and loads them into the current process. - DotEnvFile.Line
-
Represents a
KEY=VALUE
pair in a dotenv file. - Extend
-
A wrapper around a simple [String: Any] storage dictionary used to implement
Extendable
. - File
-
Represents a single file.
- FileIO
-
FileIO
is a convenience wrapper around SwiftNIO'sNonBlockingFileIO
. - Storage
- URI
- URI.Scheme
-
A URI's scheme.
- Validation
- ValidationResult
- Validations
- ValidationsResult
- ValidationsError
- Validator
- ValidatorResults
- ValidatorResults.Nested
- ValidatorResults.NestedEach
- ValidatorResults.Skipped
- ValidatorResults.Missing
- ValidatorResults.NotFound
- ValidatorResults.Codable
- ValidatorResults.Invalid
- ValidatorResults.TypeMismatch
- ValidatorResults.And
-
ValidatorResult
of "And"Validator
that combines twoValidatorResults
. If both results are successful the combined result is as well. - ValidatorResults.Case
-
ValidatorResult
of a validator that validates whether the data can be represented as a specific Enum case. - ValidatorResults.CharacterSet
-
ValidatorResult
of a validator that validates that aString
contains characters in a givenCharacterSet
. - ValidatorResults.CollectionCharacterSet
-
ValidatorResult
of a validator that validates that all elements of a[String]
contain characters in a givenCharacterSet
. - ValidatorResults.Email
-
ValidatorResult
of a validator that validates whether aString
is a valid email address. - ValidatorResults.Empty
-
ValidatorResult
of a validator that validates whether the data is empty. - ValidatorResults.In
-
ValidatorResult
of a validator that validates whether an item is contained in the supplied sequence. - ValidatorResults.Nil
-
ValidatorResult
of a validator that validates that the data isnil
. - ValidatorResults.NilIgnoring
-
ValidatorResult
of a validator that ignores nil values. - ValidatorResults.Not
- ValidatorResults.Or
-
ValidatorResult
of "Or"Validator
that combines twoValidatorResults
. If either result is successful the combined result is as well. - ValidatorResults.Range
-
ValidatorResult
of a validator that validates whether the input is within a supplied range. - ValidatorResults.URL
-
ValidatorResult
of a validator that validates whether a string is a valid URL. - ValidatorResults.Valid
-
ValidatorResult
of a validator that validates that the data is valid`. - Application.Views
- Application.Views.Provider
- PlaintextRenderer
- View
Enumerations
- Application.EventLoopGroupProvider
- BcryptError
- CacheExpirationTime
-
Defines the lifetime of an entry in a cache.
- ServeCommand.Error
-
Errors that may be thrown when serving a server
- HelpFormat
-
Available formatting options for generating debug info for
Debuggable
errors. - BodyStreamResult
- EndpointCacheError
- HTTPCookies.SameSitePolicy
-
A cookie which can only be sent in requests originating from the same origin as the target domain.
- HTTPHeaders.RangeUnit
-
The unit in which
ContentRange
s andRange
s are specified. This is usuallybytes
. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range - HTTPHeaders.Range.Value
-
Represents one value of the
Range
request header. - HTTPHeaders.ContentRange.Value
-
Represents the value of the
Content-Range
request header. - HTTPVersionMajor
- CORSMiddleware.AllowOriginSetting
-
Option for the allow origin header in responses for CORS requests.
- Middlewares.Position
- RedirectType
-
Specifies the type of redirect that the client should receive.
- HTTPBodyStreamStrategy
-
Determines how an incoming HTTP request's body is collected.
- OTPDigits
-
Supported OTP output sizes.
- OTPDigest
-
Supported OTP digests.
- BindAddress
- URLEncodedFormDecoder.Configuration.DateDecodingStrategy
-
Supported date formats
- URLEncodedFormEncoder.Configuration.ArrayEncoding
-
Supported array encodings.
- URLEncodedFormEncoder.Configuration.DateEncodingStrategy
-
Supported date formats
- Base32
- Base64
- BasicCodingKey
-
A basic
CodingKey
implementation. - RangeResult
-
Type used by
Range
andCount
validators to indicate where a value fell within a range. - ValidationKey
Protocols
- LockKey
- Authenticatable
-
Capable of being authenticated.
- Authenticator
-
Helper for creating authentication middleware.
- RequestAuthenticator
-
Help for creating authentication middleware based on
Request
. - BasicAuthenticator
-
Helper for creating authentication middleware using the Basic authorization header.
- BearerAuthenticator
-
Helper for creating authentication middleware using the Bearer authorization header.
- CredentialsAuthenticator
-
Helper for creating authentication middleware using request body contents.
- SessionAuthenticator
-
Helper for creating authentication middleware in conjunction with
SessionsMiddleware
. - SessionAuthenticatable
-
Models conforming to this protocol can have their authentication status cached using
SessionAuthenticator
. - Cache
-
Codable key-value pair cache.
- Client
- AsyncMiddleware
-
AsyncMiddleware
is placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses.AsyncMiddleware
can choose to pass requests on to the nextAsyncMiddleware
in a chain, or they can short circuit and return a customResponse
if desired. - AsyncSessionDriver
-
Capable of managing CRUD operations for
Session
s. - AsyncAuthenticator
-
Helper for creating authentication middleware.
- AsyncRequestAuthenticator
-
Help for creating authentication middleware based on
Request
. - AsyncBasicAuthenticator
-
Helper for creating authentication middleware using the Basic authorization header.
- AsyncBearerAuthenticator
-
Helper for creating authentication middleware using the Bearer authorization header.
- AsyncCredentialsAuthenticator
-
Helper for creating authentication middleware using request body contents.
- AsyncSessionAuthenticator
-
Helper for creating authentication middleware in conjunction with
SessionsMiddleware
. - AsyncResponder
- AsyncResponseEncodable
-
Can convert
self
to aResponse
. - AsyncRequestDecodable
-
Can convert
Request
to aSelf
. - Content
-
Convertible to / from content in an HTTP message.
- ContentEncoder
- ContentDecoder
- ContentContainer
- URLQueryDecoder
- URLQueryEncoder
- URLQueryContainer
-
Helper for encoding and decoding data from an HTTP request query string.
- AbortError
-
Errors conforming to this protocol will always be displayed by Vapor to the end-user (even in production mode where most errors are silenced).
- DebuggableError
-
Debuggable
provides an interface that allows a type to be more easily debugged in the case of an error. - BodyStreamWriter
- Responder
- Upgrader
-
Conformance for any struct that performs an HTTP Upgrade
- Middleware
-
Middleware
is placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses.Middleware
can choose to pass requests on to the nextMiddleware
in a chain, or they can short circuit and return a customResponse
if desired. - PasswordHasher
- ResponseEncodable
-
Can convert
self
to aResponse
. - RequestDecodable
-
Can convert
Request
to aSelf
. - RouteCollection
-
Groups collections of routes together for adding to a router.
- RoutesBuilder
- Server
- SessionDriver
-
Capable of managing CRUD operations for
Session
s. - CodingKeyRepresentable
-
Capable of being represented by a
CodingKey
. - Extendable
-
Types conforming to
Extendable
can have stored properties added in extension by using theExtend
struct. - LifecycleHandler
- OptionalType
-
Capable of being represented by an optional wrapped type.
- AnyOptionalType
-
Type-erased
OptionalType
- StorageKey
- Validatable
-
Capable of being validated. Conformance adds a throwing
validate()
method. - ValidatorResult
- ViewRenderer
Typealiases
- HTTPStatus
-
Less verbose typealias for
HTTPResponseStatus
.
Functions
- _stdlib_demangleImpl(mangledName:mangledNameLength:outputBuffer:outputBufferSize:flags:)
-
Here be dragons! _stdlib_demangleImpl is linked into the stdlib. Use at your own risk!
Variables
- Bcrypt
-
Creates and verifies BCrypt hashes.
Extensions
- Array
- BinaryFloatingPoint
- Collection
- CommandContext
- Data
- Date
- DecodingError
- Dictionary
- EventLoopFuture
- FixedWidthInteger
- FormDataDecoder
- FormDataEncoder
- HTTPHeaders
- HTTPHeaders.Range.Value
- HTTPMethod
- HTTPPart
- HTTPStatus
- Int
- JSONDecoder
- JSONEncoder
- Logger
- Logger.Level
- LoggingSystem
- MultipartPart
- Optional
- Parameters
- RandomAccessCollection
- Sequence
- SocketAddress
- StaticString
- String
- Substring
- Thread
- UUID