APIServerWorker class final

Inheritance

Constructors

APIServerWorker(int workerIndex, APIRoot apiRoot, {required String? name, required String? version, String? address, int? port, int? securePort, Object? domains, Object? letsEncryptDirectory, bool letsEncrypt = false, bool? letsEncryptProduction, bool? allowRequestLetsEncryptCertificate, bool hotReload = false, int? totalWorkers = 1, bool? cookieless, bool? useSessionID, String? apiCacheControl, String? staticFilesCacheControl, String? longLivedStaticFilesCacheControl, Object? longLivedStaticFilesCached, APICrossOriginConfig? crossOrigin, bool? cacheStaticFilesResponses, int? staticFilesCacheMaxMemorySize, int? staticFilesCacheMaxContentLength, int? maxPayloadLength, bool? decompressPayload, Duration? serverResponseDelay, bool? logToConsole, bool? logQueue})

Properties

address → String
The bind address of this server.
finalinherited
allowRequestLetsEncryptCertificate → bool
If true allows the request of Let's Encrypt certificates.
finalinherited
apiCacheControl → String
The cache-control header for API responses.
finalinherited
apiConfig → APIConfig?
The APIConfig of the APIRoot.
finalinherited
apiInfoURL → String
The local API-INFO URL of this server.
no setterinherited
apiRoot → APIRoot
The API root of this server.
finalinherited
args → ArgsSimple
All the parsed arguments, using ArgsSimple.
finalinherited
cacheStaticFilesResponses → bool
If true will cache static files. Default: true
finalinherited
canUseLetsEncrypt → bool
Returns true if the basic conditions for Let's Encrypt are configured.
no setterinherited
cookieless → bool
If true will remove any Set-Cookie or Cookie header.
finalinherited
crossOrigin → APICrossOriginConfig
The cross-origin configuration: the CORS headers of API responses and the cross-origin isolation headers of static file responses.
finalinherited
decompressPayload → bool
Whether to decompress the request payload if it is compressed using a supported Content-Encoding (e.g., gzip or deflate).
finalinherited
development → bool
finalinherited
domains → List<String>
Returns a list of domains at domainsRoots keys (non RegExp entries).
no setterinherited
domainsRoots → Map<Pattern, Directory>
The domains root directories.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
hasMultipleWorkers → bool
no setter
hotReload → bool
If true enables Hot Reload (APIHotReload.enable).
finalinherited
id → int
ID of this instance.
latefinalinherited
isAuxiliaryWorker → bool
no setter
isMainWorker → bool
no setter
isStarted → bool
Returns true if this servers is started.
no setterinherited
isStarting → bool
Returns true if this instance is currently in the process of starting.
no setterinherited
isStopped → bool
Returns true if this server is closed.type
no setterinherited
letsEncrypt → bool
If true enabled Let's Encrypt.
finalinherited
letsEncryptDirectory → Directory?
The Let's Encrypt certificates Directory.
finalinherited
letsEncryptProduction → bool
If true runs Let's Encrypt in production mode.
finalinherited
logQueue ↔ bool
If false disables log flush queue.
latefinalinherited
logToConsole ↔ bool
If true log messages to stdout (console).
latefinalinherited
longLivedStaticFilesCacheControl → String
The cache-control for long-lived static files. See longLivedStaticFilesCached.
finalinherited
longLivedStaticFilesCached → List<Pattern>
Patterns of files using longLivedStaticFilesCacheControl. See staticFilesCacheControl.
finalinherited
maxPayloadLength → int?
The maximum allowed request payload size in bytes.
finalinherited
name → String
The name of this server.
finalinherited
port → int
The listen port of this server (HTTP).
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securePort → int
The listen secure port of this server (HTTPS).
finalinherited
serverName → String
The server header value.
no setterinherited
serverResponseDelay → Duration?
A forced delay in each server response. Only active if development is true.
finalinherited
staticFilesCacheControl → String
The cache-control header for static files.
finalinherited
staticFilesCacheMaxContentLength → int
The maximum Content-Length (in bytes) allowed for a cached Response. Default: 10M
finalinherited
staticFilesCacheMaxMemorySize → int
The maximum memory size (in bytes) for storing all cached Responses. Default: 50M
finalinherited
totalWorkers → int
The number of APIServerWorker instances to spawn.
finalinherited
url → String
The local URL of this server.
no setterinherited
urlHost → String
The host of url;
no setterinherited
useSessionID → bool
If true the server will use/generate a SESSIONID for each request. If false will ignore any SESSIONID cookie (useful to comply with cookieless servers).
finalinherited
version → String
The version of this server.
finalinherited
workerDebugName → String
no setter
workerIndex → int
final

Methods

isLongLivedStaticFileCached(String filePath) → bool
Returns true if filePath matches any pattern in longLivedStaticFilesCached.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeStaticFileCookies(Response response) → Response
Removes any Set-Cookie from a static file response when cookieless is on, returning response untouched otherwise.
spawnIsolate() → Future<(Isolate?, PortListener?, SendPort?, Future<bool>?)>
start() → Future<bool>
Starts this server.
inherited
stop() → Future<void>
Stops/closes this server.
inherited
toJson() → Map<String, dynamic>
inherited
toString() → String
A string representation of this object.
override
waitStopped() → Future<bool>
Returns a Future that completes when this server stops.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

initializationTimeout → const Duration