SleelaDoc API
HTML documentation for the SLeeLa standard library (/lib)
Home › Packages › web-server-technology

Package web-server-technology

This package contains 8 source unit(s) defining 8 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

demo-web-server-technology #sleela 2.5 (lib/web-server-technology/demo-web-server-technology.sleela)

DemoWebServerTechnology class

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
mainvoid main()No description in source.

SLDualStackBinding #sleela 2.5 (lib/web-server-technology/SLDualStackBinding.sleela)

SLDualStackBinding class

Defines the SLeeLa standard-library type SLDualStackBinding, the SLeeLa-side model of the native listener binding that accepts the full range of world IP addresses over IPv6 with IPv4-mapped fallback.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
addressString address---- Binding descriptor ---- Explicit bind address literal; empty means all interfaces.
portint portTCP port.
dualStackboolean dualStackTrue when one AF_INET6 socket also accepts IPv4-mapped peers.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(int listenPort)No description in source.
bindTovoid bindTo(String literal)No description in source.
getAddressString getAddress()No description in source.
getPortint getPort()No description in source.
isDualStackboolean isDualStack()No description in source.
reachesWorldboolean reachesWorld()Whether this binding reaches the full range of world IP addresses: true only when bound to all interfaces as dual-stack.
serviceNameString serviceName()No description in source.

SLEnvelopment #sleela 2.5 (lib/web-server-technology/SLEnvelopment.sleela)

SLEnvelopment class

Defines the SLeeLa standard-library type SLEnvelopment, the SLeeLa-side model of Side 2: a domain that fronts many disparate programs via warrants, gated to Scientists. Native counterpart: web-server-technology/native/envelopment.cpp.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
enabledboolean enabled---- Envelopment state (mirrors struct Envelopment in envelopment.h) ---- Master switch; Side 2 is off (Side 1 only) unless this is true.
scientistboolean scientistCapability gate; envelopment requires a Scientist.
domainString domainThe domain this envelopment fronts.
programCountint programCountCount of declared programs and warrants (the native side owns the lists).
warrantCountint warrantCountNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String domainName)No description in source.
getDomainString getDomain()No description in source.
turnOnvoid turnOn()Turn Side 2 on. Does not by itself activate; see active(). Named turnOn() rather than enable() because enable is a reserved Munction builtin.
turnOffvoid turnOff()No description in source.
grantScientistvoid grantScientist()Assert the Scientist capability that gates Side 2.
hasScientistboolean hasScientist()No description in source.
registerProgramvoid registerProgram()The native loader populates these as it parses the config. The SLeeLa model tracks the counts so active() can enforce the "at least one warrant" rule.
registerWarrantvoid registerWarrant()No description in source.
getProgramCountint getProgramCount()No description in source.
getWarrantCountint getWarrantCount()No description in source.
activeboolean active()Side 2 is usable only with BOTH gates set and at least one warrant. This is the exact rule enforced natively by Envelopment::active().
serviceNameString serviceName()No description in source.

SLPackage #sleela 2.5 (lib/web-server-technology/SLPackage.sleela)

SLPackage class

Defines the SLeeLa standard-library package for web-server-technology, the dynamic SQL-backed web server family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
packageNameString packageNameNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String name)No description in source.
nameString name()No description in source.
availableboolean available()No description in source.

SLSqlEndpoint #sleela 2.5 (lib/web-server-technology/SLSqlEndpoint.sleela)

SLSqlEndpoint class

Defines the SLeeLa standard-library type SLSqlEndpoint, the SLeeLa-side model of the dynamic /db route that executes SQL against the CSV-backed SLeeLa SQL engine and returns JSON.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
routePrefixString routePrefix---- Endpoint policy (mirrors db_endpoint in the native server) ---- Route prefix served by this endpoint.
writableboolean writableWhen true, mutating statements are permitted; otherwise read-only.
maxStatementBytesint maxStatementBytesMaximum SQL text length accepted, in bytes. Native bound is 8192.
maxRowsint maxRowsMaximum rows serialized into a single JSON response. Native bound is 10000.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String prefix)No description in source.
getRoutePrefixString getRoutePrefix()No description in source.
allowWritesvoid allowWrites()No description in source.
writesAllowedboolean writesAllowed()No description in source.
setMaxStatementBytesvoid setMaxStatementBytes(int n)No description in source.
getMaxStatementBytesint getMaxStatementBytes()No description in source.
setMaxRowsvoid setMaxRows(int n)No description in source.
getMaxRowsint getMaxRows()No description in source.
isReadOnlyVerbboolean isReadOnlyVerb(String verb)Classify whether a leading keyword is a read-only verb. Mirrors the native statement_is_readonly policy: SELECT, SHOW, and the fluent from()/tables() forms are reads; everything else is a mutation.
permitsboolean permits(String verb)Decide whether a statement with the given leading verb is permitted under the current policy.
serviceNameString serviceName()No description in source.

SLWarrant #sleela 2.5 (lib/web-server-technology/SLWarrant.sleela)

SLWarrant class

Defines the SLeeLa standard-library type SLWarrant, the SLeeLa-side model of an envelopment warrant: a cause served for a subject by a named program.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
causeString cause---- Warrant descriptor (mirrors struct Warrant in envelopment.h) ---- The reason-to-serve, recorded for provenance and logged on each match.
subjectString subjectHost to match; "*" matches any host.
pathPrefixString pathPrefixOptional additional path gate; empty matches any path.
programString programName of the program this warrant activates.
enabledboolean enabledA disabled warrant never matches.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String causeText)No description in source.
getCauseString getCause()No description in source.
setSubjectvoid setSubject(String host)No description in source.
getSubjectString getSubject()No description in source.
setPathPrefixvoid setPathPrefix(String prefix)No description in source.
getPathPrefixString getPathPrefix()No description in source.
bindProgramvoid bindProgram(String programName)No description in source.
getProgramString getProgram()No description in source.
disablevoid disable()No description in source.
isEnabledboolean isEnabled()No description in source.
matchesHostboolean matchesHost(String host)Whether this warrant matches a request for the given host. Path-prefix matching is performed natively; this models the host/enabled gate.
serviceNameString serviceName()No description in source.

SLWebProgram #sleela 2.5 (lib/web-server-technology/SLWebProgram.sleela)

SLWebProgram class

Defines the SLeeLa standard-library type SLWebProgram, the SLeeLa-side model of a mounted program in a Side-2 envelopment: a named unit of behaviour whose backing kind is static, sql, or meme. Named SLWebProgram (not SLProgram) to avoid colliding with the existing lib/cpu/SLProgram.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
programNameString programName---- Program descriptor (mirrors struct Program in envelopment.h) ---- Unique program name within its envelopment.
kindString kindBacking kind: "static", "sql", or "meme".
mountString mountPath prefix this program owns under the domain, e.g. "/papers".
rootString rootstatic: document-root subtree.
databaseDirectoryString databaseDirectorysql: directory of CSV tables.
databaseWritableboolean databaseWritablesql: whether mutations are permitted.
memeBodyString memeBodymeme: fixed response body.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String name)No description in source.
getProgramNameString getProgramName()No description in source.
setMountvoid setMount(String m)No description in source.
getMountString getMount()No description in source.
asStaticvoid asStatic(String documentRoot)Shape this program as a static-file surface.
asSqlvoid asSql(String tableDirectory)Shape this program as a SQL surface over a table directory.
asMemevoid asMeme(String body)Shape this program as a single fixed meme response.
allowDatabaseWritesvoid allowDatabaseWrites()No description in source.
getKindString getKind()No description in source.
isStaticboolean isStatic()No description in source.
isSqlboolean isSql()No description in source.
isMemeboolean isMeme()No description in source.
serviceNameString serviceName()No description in source.

SLWebServer #sleela 2.5 (lib/web-server-technology/SLWebServer.sleela)

SLWebServer class

Defines the SLeeLa standard-library type SLWebServer, the SLeeLa-side model of the dynamic SQL-backed HTTP/1.1 web server whose native implementation lives at web-server-technology/native/dyn_sql_server.cpp.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
rootString root---- Server configuration (mirrors the native command-line contract) ---- Document root for static files.
portint portTCP port the listener binds. Native default is 8090.
threadsint threadsWorker-thread count. Native default is 16, maximum 256.
bindAddressString bindAddressBind address; empty means all interfaces as dual-stack IPv6 plus IPv4.
databaseDirectoryString databaseDirectoryDirectory of CSV tables for the dynamic /db endpoint; empty disables it.
databaseWritableboolean databaseWritableWhen false the /db endpoint rejects mutating statements.
stateint stateLifecycle state: 0 configured/stopped, 1 running.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String documentRoot)No description in source.
setPortvoid setPort(int p)No description in source.
getPortint getPort()No description in source.
setThreadsvoid setThreads(int n)No description in source.
getThreadsint getThreads()No description in source.
setBindAddressvoid setBindAddress(String a)No description in source.
getBindAddressString getBindAddress()No description in source.
enableDatabasevoid enableDatabase(String tableDirectory)Enable the dynamic SQL endpoint against a directory of CSV tables.
allowDatabaseWritesvoid allowDatabaseWrites()Permit mutating SQL on the /db endpoint. Default policy is read-only.
databaseEnabledboolean databaseEnabled()No description in source.
writesAllowedboolean writesAllowed()No description in source.
openvoid open()Transition to the running state. The native listener performs the actual bind, dual-stack setup, and request service.
shutdownServervoid shutdownServer()Graceful stop. Named shutdownServer() rather than close() because close is a reserved Munction reach-handle builtin in the SLeeLa runtime.
activeboolean active()No description in source.
serviceNameString serviceName()No description in source.