pub struct GitHubWebhook { /* private fields */ }Expand description
GitHub webhook handler
Implementations§
Source§impl GitHubWebhook
impl GitHubWebhook
Sourcepub fn verify_signature(&self, body: &[u8], signature: &str) -> Result<bool>
pub fn verify_signature(&self, body: &[u8], signature: &str) -> Result<bool>
Verify webhook signature using HMAC-SHA256
GitHub sends the signature in the X-Hub-Signature-256 header
Sourcepub fn parse_payload(&self, body: &[u8]) -> Result<GitHubWebhookPayload>
pub fn parse_payload(&self, body: &[u8]) -> Result<GitHubWebhookPayload>
Parse webhook payload
Sourcepub fn issue_to_content(issue: &GitHubIssue, repo: &GitHubRepository) -> String
pub fn issue_to_content(issue: &GitHubIssue, repo: &GitHubRepository) -> String
Transform GitHub issue to memory content
Sourcepub fn pr_to_content(pr: &GitHubPullRequest, repo: &GitHubRepository) -> String
pub fn pr_to_content(pr: &GitHubPullRequest, repo: &GitHubRepository) -> String
Transform GitHub PR to memory content
Sourcepub fn commit_to_content(
commit: &GitHubCommit,
repo: &GitHubRepository,
) -> String
pub fn commit_to_content( commit: &GitHubCommit, repo: &GitHubRepository, ) -> String
Transform GitHub commit to memory content
Extract tags from GitHub issue
Extract tags from GitHub PR
Extract tags from GitHub commit
Sourcepub fn determine_change_type(action: &str, is_pr: bool) -> String
pub fn determine_change_type(action: &str, is_pr: bool) -> String
Determine change type from webhook action
Sourcepub fn issue_external_id(repo: &GitHubRepository, issue_number: u64) -> String
pub fn issue_external_id(repo: &GitHubRepository, issue_number: u64) -> String
Build external_id for issue
Sourcepub fn pr_external_id(repo: &GitHubRepository, pr_number: u64) -> String
pub fn pr_external_id(repo: &GitHubRepository, pr_number: u64) -> String
Build external_id for PR
Sourcepub fn commit_external_id(repo: &GitHubRepository, sha: &str) -> String
pub fn commit_external_id(repo: &GitHubRepository, sha: &str) -> String
Build external_id for commit
Auto Trait Implementations§
impl Freeze for GitHubWebhook
impl RefUnwindSafe for GitHubWebhook
impl Send for GitHubWebhook
impl Sync for GitHubWebhook
impl Unpin for GitHubWebhook
impl UnsafeUnpin for GitHubWebhook
impl UnwindSafe for GitHubWebhook
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more