-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use GithubConfig to wrap token and discord webhook
github_release and github_verify now plain async's rather than middleware
- Loading branch information
1 parent
013aac2
commit 0739fca
Showing
11 changed files
with
486 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#[derive(Clone)] | ||
pub struct Webhook | ||
{ | ||
addr: String | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use std::fmt::Write; | ||
use regex::Regex; | ||
|
||
pub fn dump_bytes(v: &[u8]) -> String | ||
{ | ||
let mut byte_string = String::new(); | ||
for &byte in v | ||
{ | ||
write!(&mut byte_string, "{:0>2X}", byte).expect("byte dump error"); | ||
}; | ||
byte_string | ||
} | ||
|
||
pub fn read_bytes(v: String) -> Vec<u8> | ||
{ | ||
(0..v.len()).step_by(2) | ||
.map | ||
( | ||
|index| u8::from_str_radix(&v[index..index+2], 16).unwrap() | ||
) | ||
.collect() | ||
} | ||
|
||
pub fn strip_control_characters(s: String) -> String | ||
{ | ||
let re = Regex::new(r"[\u0000-\u001F]").unwrap().replace_all(&s, ""); | ||
return re.to_string() | ||
} |
Oops, something went wrong.