moonbitstack/moonasgi/spec does not have a README file
pub(all) enum Event {
HttpRequest(body~ : Bytes, more_body~ : Bool)
HttpDisconnect
HttpResponseStart(status~ : Int, headers~ : Array[(String, String)], trailers~ : Bool)
HttpResponseBody(body~ : Bytes, more_body~ : Bool)
HttpResponseTrailers(headers~ : Array[(String, String)], more_trailers~ : Bool)
HttpResponsePush(path~ : String, headers~ : Array[(String, String)])
HttpResponsePathSend(path~ : String)
HttpResponseZeroCopySend(fd~ : Int, offset~ : Int?, count~ : Int?, more_body~ : Bool)
HttpResponseDebug(info~ : Json)
HttpResponseEarlyHint(links~ : Array[String])
WebSocketConnect
WebSocketReceive(text~ : String?, bytes~ : Bytes?)
WebSocketDisconnect(code~ : Int, reason~ : String?)
WebSocketAccept(subprotocol~ : String?, headers~ : Array[(String, String)])
WebSocketSendText(String)
WebSocketSendBytes(Bytes)
WebSocketClose(code~ : Int, reason~ : String)
WebSocketHttpResponseStart(status~ : Int, headers~ : Array[(String, String)], trailers~ : Bool)
WebSocketHttpResponseBody(body~ : Bytes, more_body~ : Bool)
LifespanStartup
LifespanShutdown
LifespanStartupComplete
LifespanStartupFailed(message~ : String)
LifespanShutdownComplete
LifespanShutdownFailed(message~ : String)
Other(type_~ : String, payload~ : Json)
} derive(Eq)pub(all) struct Extensions {
tls : TlsExtension?
http_response_push : Bool
http_response_trailers : Bool
http_response_pathsend : Bool
http_response_zerocopysend : Bool
http_response_early_hint : Bool
http_response_debug : Bool
websocket_http_response : Bool
custom : Map[String, Json]
} derive(Eq)pub(all) enum Http2HeaderError {
MissingMethod
MissingScheme
MissingPath
EmptyPath
DuplicatePseudoHeader(String)
UnknownPseudoHeader(String)
PseudoHeaderAfterRegular(String)
} derive(Eq)pub(all) struct HttpScope {
http_version : String
http_method : String
scheme : String
path : String
raw_path : Bytes
query_string : Bytes
root_path : String
headers : Array[(String, String)]
client : (String, Int)?
server : (String, Int?)?
asgi : AsgiVersion
extensions : Extensions
state : Map[String, Json]
}fn HttpScope::from_h2_headers(headers : Array[(String, String)], http_version? : String, root_path? : String, client? : (String, Int), server? : (String, Int?), extensions? : Extensions, asgi? : AsgiVersion, state? : Map[String, Json]) -> Result[HttpScope, Http2HeaderError]fn HttpScope::new(http_method~ : String, path~ : String, http_version? : String, scheme? : String, raw_path? : Bytes, query_string? : Bytes, root_path? : String, headers? : Array[(String, String)], client? : (String, Int), server? : (String, Int?), asgi? : AsgiVersion, extensions? : Extensions, state? : Map[String, Json]) -> HttpScopepub(all) struct WebSocketScope {
http_version : String
scheme : String
path : String
raw_path : Bytes
query_string : Bytes
root_path : String
headers : Array[(String, String)]
client : (String, Int)?
server : (String, Int?)?
subprotocols : Array[String]
asgi : AsgiVersion
extensions : Extensions
state : Map[String, Json]
}fn WebSocketScope::new(path~ : String, http_version? : String, scheme? : String, raw_path? : Bytes, query_string? : Bytes, root_path? : String, headers? : Array[(String, String)], client? : (String, Int), server? : (String, Int?), subprotocols? : Array[String], asgi? : AsgiVersion, extensions? : Extensions, state? : Map[String, Json]) -> WebSocketScopefn guarantee_single_callable(app : AsgiApplication) -> (async (Scope, async () -> Event, async (Event) -> Unit) -> Unit)fn latin1_decode(bytes : Bytes) -> Stringfn latin1_encode(s : String) -> Bytesfn percent_decode(target : String) -> Bytesfn split_target(target : String) -> (String, String)Install
Download zipMoonBit-dialect ASGI 3.0 — the load-bearing server↔app SEAM (Scope / Receive / Send) that the moon* full-stack web suite (mooncat, moonapi, moonrpc, moongql, moonzero) is built around.