moonbitstack/moonapi/route does not have a README file
pub(open) trait View {
fn get(Self) -> async (Context) -> Response? = _
fn head(Self) -> async (Context) -> Response? = _
fn post(Self) -> async (Context) -> Response? = _
fn put(Self) -> async (Context) -> Response? = _
fn patch(Self) -> async (Context) -> Response? = _
fn delete(Self) -> async (Context) -> Response? = _
fn options(Self) -> async (Context) -> Response? = _
fn trace(Self) -> async (Context) -> Response? = _
}struct Articles { db : Db }
impl @moonapi.View for Articles with get(self) {
Some(ctx => self.db.list(ctx))
}
impl @moonapi.View for Articles with post(self) {
Some(ctx => self.db.create(ctx))
}
app.view("/articles", Articles::{ db })pub(all) struct Route {
verb : Method
path : String
pattern : Pattern
run : async (Context) -> Reply
summary : String
description : String
tags : Array[String]
deprecated : Bool
operation_id : String
status_code : Int?
responses : Array[ResponseSpec]
name : String
openapi_extra : Json?
endpoint : Endpoint?
security : Array[SecurityRequirement]
dependencies : Array[String]
callbacks : Array[Route]
hoops : Array[async (Context, async (Context) -> Reply) -> Reply]
include_in_schema : Bool
validate : Bool
}fn Router::delete(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::get(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::head(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::include_router(self : Router, router : Router, prefix? : String, tags? : Array[String], security? : Array[SecurityRequirement], dependencies? : Array[String], responses? : Array[ResponseSpec], deprecated? : Bool, include_in_schema? : Bool, hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::options(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::patch(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::post(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::put(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::route(self : Router, verb : Method, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::route_stream(self : Router, verb : Method, path : String, handler : async (Context) -> Stream, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::stream(self : Router, path : String, handler : async (Context) -> Stream, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitfn Router::trace(self : Router, path : String, handler : async (Context) -> Response, summary? : String, description? : String, tags? : Array[String], deprecated? : Bool, operation_id? : String, status_code? : Int, responses? : Array[ResponseSpec], name? : String, endpoint? : Endpoint, security? : Array[SecurityRequirement], dependencies? : Array[String], include_in_schema? : Bool, validate? : Bool, openapi_extra? : Json, callbacks? : Array[Route], hoops? : Array[async (Context, async (Context) -> Reply) -> Reply]) -> Unitpub(all) struct WsRoute {
path : String
pattern : Pattern
handler : async (WebSocket) -> Unit
name : String
security : Array[SecurityRequirement]
dependencies : Array[String]
}fn join_prefix(prefix : String, path : String) -> String