88//! routes and their handler functions.
99//!
1010//! ```
11- //! use stackable_webhook::{WebhookServer, Options };
11+ //! use stackable_webhook::{WebhookServer, WebhookOptions };
1212//! use axum::Router;
1313//!
1414//! # async fn test() {
1515//! let router = Router::new();
16- //! let (server, cert_rx) = WebhookServer::new(router, Options ::default())
16+ //! let (server, cert_rx) = WebhookServer::new(router, WebhookOptions ::default())
1717//! .await
1818//! .expect("failed to create WebhookServer");
1919//! # }
@@ -46,7 +46,7 @@ pub mod servers;
4646pub mod tls;
4747
4848// Selected re-exports
49- pub use crate :: options:: Options ;
49+ pub use crate :: options:: WebhookOptions ;
5050
5151/// A generic webhook handler receiving a request and sending back a response.
5252///
@@ -88,23 +88,23 @@ pub struct WebhookServer {
8888impl WebhookServer {
8989 /// Creates a new ready-to-use webhook server.
9090 ///
91- /// The server listens on `socket_addr` which is provided via the [`Options`]
92- /// and handles routing based on the provided Axum `router`. Most of the time
93- /// it is sufficient to use [`Options ::default()`]. See the documentation
94- /// for [`Options`] for more details on the default values.
91+ /// The server listens on `socket_addr` which is provided via the [`WebhookOptions`] and handles
92+ /// routing based on the provided Axum `router`. Most of the time it is sufficient to use
93+ /// [`WebhookOptions ::default()`]. See the documentation for [`WebhookOptions`] for more details
94+ /// on the default values.
9595 ///
9696 /// To start the server, use the [`WebhookServer::run()`] function. This will
9797 /// run the server using the Tokio runtime until it is terminated.
9898 ///
9999 /// ### Basic Example
100100 ///
101101 /// ```
102- /// use stackable_webhook::{WebhookServer, Options };
102+ /// use stackable_webhook::{WebhookServer, WebhookOptions };
103103 /// use axum::Router;
104104 ///
105105 /// # async fn test() {
106106 /// let router = Router::new();
107- /// let (server, cert_rx) = WebhookServer::new(router, Options ::default())
107+ /// let (server, cert_rx) = WebhookServer::new(router, WebhookOptions ::default())
108108 /// .await
109109 /// .expect("failed to create WebhookServer");
110110 /// # }
@@ -113,11 +113,11 @@ impl WebhookServer {
113113 /// ### Example with Custom Options
114114 ///
115115 /// ```
116- /// use stackable_webhook::{WebhookServer, Options };
116+ /// use stackable_webhook::{WebhookServer, WebhookOptions };
117117 /// use axum::Router;
118118 ///
119119 /// # async fn test() {
120- /// let options = Options ::builder()
120+ /// let options = WebhookOptions ::builder()
121121 /// .bind_address([127, 0, 0, 1], 8080)
122122 /// .add_subject_alterative_dns_name("my-san-entry")
123123 /// .build();
@@ -130,7 +130,7 @@ impl WebhookServer {
130130 /// ```
131131 pub async fn new (
132132 router : Router ,
133- options : Options ,
133+ options : WebhookOptions ,
134134 ) -> Result < ( Self , mpsc:: Receiver < Certificate > ) > {
135135 tracing:: trace!( "create new webhook server" ) ;
136136
@@ -154,13 +154,9 @@ impl WebhookServer {
154154 . route ( "/health" , get ( || async { "ok" } ) ) ;
155155
156156 tracing:: debug!( "create TLS server" ) ;
157- let ( tls_server, cert_rx) = TlsServer :: new (
158- options. socket_addr ,
159- router,
160- options. subject_alterative_dns_names ,
161- )
162- . await
163- . context ( CreateTlsServerSnafu ) ?;
157+ let ( tls_server, cert_rx) = TlsServer :: new ( router, options)
158+ . await
159+ . context ( CreateTlsServerSnafu ) ?;
164160
165161 Ok ( ( Self { tls_server } , cert_rx) )
166162 }
0 commit comments