Octofer is an innovative framework for building GitHub Apps in Rust, inspired by Probot. This cutting-edge tool simplifies the development process by providing a clean, type-safe way to build GitHub Apps with minimal boilerplate and automatic webhook handling.
Simplifying GitHub App Development
With Octofer, you can streamline your app development experience by handling various tasks efficiently:
- Webhook events: Automatically receive and route GitHub webhook events without writing extra code.
- Authentication: Seamlessly manage GitHub App authentication and installation tokens, reducing complexity and errors.
- Type safety: Enjoy full Rust type safety for GitHub API interactions, ensuring your code is robust and reliable.
- Simple APIs: Register event handlers with ease using clean, intuitive APIs.
Explore the Power of Octofer
Octofer supports a wide range of GitHub webhook events, including:
- Issue events (opened, closed, edited, etc.)
- Pull request events (opened, closed, merged, etc.)
- Push events
- And many more!
To get started with Octofer, check out the examples directory or explore the example code below:
`rust
use std::sync::Arc;
use octofer::{Octofer, Config};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Initialize configuration and start the app
let config = Config::from_env().unwrap_or_default();
config.init_logging();
let mut app = Octofer::new(config).await.unwrap_or_else(|_| {
Octofer::new_default()
});
// Handle issue comments
app.on_issue_comment(
|context, _| async move {
println!("Issue comment event received!");
println!("Event type: {}", context.kind());
if let Some(client) = &context.github_client {
// Use GitHub API client here
println!("GitHub client available for API calls");
}
Ok(())
},
Arc::new(()),
).await;
app.start().await?;
Ok(())
}
`
Centralized Configuration
Octofer uses a centralized configuration system that loads from environment variables, making it easy to manage and update your app's settings. You can also create configuration programmatically using the Config struct.
Setting Up Octofer
To get started with Octofer, follow these steps:
- Set up environment variables for GitHub App authentication, webhook secrets, and logging configurations.
- Create a configuration programmatically or load it from environment variables.
- Build all components using Cargo.
- Run tests, format code, and run linting to ensure your app is robust and reliable.
Unlock the Power of Swift App Development with Octofer
By leveraging Octofer's centralized configuration system, automatic webhook handling, and type-safe GitHub API interactions, you can streamline your GitHub App development experience and build scalable, efficient apps that meet your needs.