hookburn-slack 0.2.0

A Rust crate for sending messages to Slack via webhooks
Documentation
// crates/hookburn-slack/src/lib.rs
#![deny(missing_docs)]

//! Slack webhook client for Hookburn.
//!
//! This crate provides a client for sending messages to Slack via incoming webhooks.
//! It implements the `WebhookSender` trait and can be used directly or through
//! the unified `hookburn` crate.
//!
//! # Example
//!
//! ```rust,no_run
//! use hookburn_slack::{SlackClient, SlackMessage};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), hookburn_slack::SlackError> {
//!     let client = SlackClient::new("https://hooks.slack.com/services/T/B/X")?;
//!
//!     let message = SlackMessage::builder()
//!         .text("Hello from Hookburn!")
//!         .build()?;
//!
//!     client.send(&message).await
//! }
//! ```

/// HTTP client with retry support and timeout handling.
pub mod client;

/// Common error types for the hookburn ecosystem.
pub mod error;

/// Service-agnostic message types and conversion traits.
pub mod message;

/// Service metadata and builder traits for service creation.
pub mod service;

pub use client::{SlackClient, SlackClientBuilder};
pub use error::SlackError;
pub use message::{
    SlackActionsBlock, SlackAttachment, SlackAttachmentField, SlackBlock, SlackButton,
    SlackContextBlock, SlackElement, SlackHeaderBlock, SlackMessage, SlackMessageBuilder,
    SlackSectionBlock, SlackText, SlackTextType,
};
pub use service::{SlackMessageConverter, SlackSenderWrapper, SlackService};

/// Register the Slack service with the global registry.
///
/// This function is called by the `hookburn` crate when the `slack` feature is enabled.
/// It returns a `SlackService` that implements the `ServiceBuilder` trait.
///
/// # Example
///
/// ```rust,no_run
/// use hookburn_slack::register_service;
/// use hookburn_core::WebhookRegistry;
///
/// let mut registry = WebhookRegistry::new();
/// registry.register(register_service());
/// ```
pub fn register_service() -> SlackService {
    SlackService::new()
}