Expand description
Process Github webhooks in tide.
§Example
#[async_std::main]
async fn main() -> tide::Result<()> {
let mut app = tide::new();
let github = tide_github::new("My Github webhook s3cr#t")
.on(Event::IssueComment, |payload| {
println!("Received a payload for repository {}", payload.repository.name);
})
.build();
app.at("/gh_webhooks").nest(github);
app.listen("127.0.0.1:3000").await?;
Ok(())
}
The API is still in development and may change in unexpected ways.
Modules§
- payload
- The payload module contains the types and conversions for the webhook payloads.
Structs§
- Server
Builder ServerBuilder
is used to first register closures to events before finally building atide::Server
using those closures.
Enums§
- Event
- This enum represents the event (and its variants the event type) for which we can receive a Github webhook.
- Event
Dispatch Error - The variants of
EventDispatchError
represent the errors that would prevent us from calling the handler to process the Github Webhook.
Functions§
- new
- Returns a
ServerBuilder
with the given webhook secret.