ServeSystem

interface ServeSystem(source)

Everything drift serve needs from the operating system.

Properties

Link copied to clipboard
abstract val files: SiteFiles
Link copied to clipboard
abstract val tlsUnavailable: String?

Why this build cannot serve TLS, or null when it can.

Functions

Link copied to clipboard
abstract fun interrupted(): Boolean
Link copied to clipboard
abstract fun listen(bind: Bind, port: Int, tls: TlsFiles?): Acceptor

Binds loopback (IPv4, and IPv6 when available) or every interface; port 0 picks one.

Link copied to clipboard
abstract fun makePrivateDirectory(path: String): Boolean

Creates path and its parents, readable by the current user only.

Link copied to clipboard
abstract fun mode(path: String): Int?

Unix permission bits of path, or null when unknown or not a unix file system.

Link copied to clipboard
abstract fun resolve(name: String): List<String>

Numeric addresses getaddrinfo returns for name; empty when it does not resolve.

Link copied to clipboard
abstract fun sleep(millis: Int)
Link copied to clipboard
abstract fun spawn(block: () -> Unit): Boolean

Runs block on another thread; false when no thread could be started.

Link copied to clipboard
abstract fun start(argv: List<String>): Child?

Starts a long-running program; null when it cannot be started.

Link copied to clipboard
abstract fun trapInterrupt()

Makes SIGINT and SIGTERM set the flag that ServeSystem.interrupted reads.