daqing/moonway/http does not have a README file
pub(open) trait CacheStore {
async fn cache_get(Self, String) -> String?
async fn cache_set_ex(Self, String, String, Int) -> Bool
}pub(all) struct CachePolicy[S] {
store : S
prefix : String
ttl : Int
}async fn[S : CacheStore] CachePolicy::lookup(self : CachePolicy[S], path : String) -> CachedResponse?async fn[S : CacheStore] CachePolicy::store(self : CachePolicy[S], path : String, cached : CachedResponse) -> Unitpub(all) struct CachedResponse {
content_type : String
body : String
}pub(all) struct Request {
verb : String
path : String
query : String
headers : Array[(String, String)]
body : String
}pub struct Response {
status_code : Int
resp_headers : Array[(String, String)]
resp_body : String
resp_bytes : Bytes?
}fn content_type_for(path : String) -> Stringfn decode_url_encoded(s : String) -> Stringfn query_param(source : String, name : String) -> String?fn resolve_static(dir : String, url_path : String) -> String? raisefn[S : CacheStore] serve_cached(policy : CachePolicy[S], port : Int, handler : (Request) -> Response, ws_routes? : Array[WsRoute]) -> Unitasync fn[S : CacheStore] serve_cached_async(policy : CachePolicy[S], port : Int, handler : (Request) -> Response, ws_routes? : Array[WsRoute]) -> Unitasync fn serve_websocket(routes : Array[WsRoute], request : Request, conn : ServerConnection) -> Bool