Skip to content

Commit 862d80c

Browse files
authored
chore: prepare hotfix-status for release (#177)
* Prepare hotfix-status for publishing * Make custom error only available for UI feature as it's only used there * Revise changelog for hotfix-status
1 parent 29136d4 commit 862d80c

8 files changed

Lines changed: 51 additions & 182 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/hotfix-status/CHANGELOG.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Other
1717

18-
- Fix initial creation time setting in redb store
19-
- Add check for code formatting
20-
- Add code coverage badge
21-
- Update version to 0.0.21 to release DynamoDB stores
22-
- Prepare for 0.0.19 release
23-
- Update README with Test Requests
24-
- Update README with next steps
25-
- Process backlog of messages when a resend is completed
26-
- Update README
27-
- Nicer API for manipulating groups and example application using repeating groups
28-
- Add badges
29-
- Update crates in preparation for 0.0.11 release
30-
- Switch to internal fork of ferrumfix for message encoding and decoding
31-
- Use fix44 types for message generation
32-
- Prepare project for crates.io publishing
33-
- Initial commit
18+
- initial release

crates/hotfix-status/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "hotfix-status"
33
description = "Status endpoints and an option web-based dashboard for the HotFIX engine"
4-
version.workspace = true
4+
version = "0.1.0"
55
authors.workspace = true
66
edition.workspace = true
77
license.workspace = true
8-
readme.workspace = true
8+
readme = "README.md"
99
homepage.workspace = true
1010
repository.workspace = true
1111
keywords.workspace = true

crates/hotfix-status/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<div align="center">
2+
3+
# hotfix-status
4+
5+
**Status APIs and UI for the HotFIX engine.**
6+
7+
</div>
8+
9+
This crate is an add-on for the [HotFIX engine](https://github.com/Validus-Risk-Management/hotfix)
10+
to provide useful APIs about the FIX session state and health.
11+
12+
Optionally, it also provides a web-based UI to view and manage the session state.
13+
14+
## Usage
15+
16+
`hotfix-status` build an `axum` router you can embed in your application in any way you like.
17+
18+
To build the router, just call `build_router` with the HotFIX session ref:
19+
20+
```rust
21+
...
22+
23+
use hotfix_status::build_router;
24+
25+
...
26+
27+
async fn start_status_service(session_ref: SessionRef<Message>) {
28+
let status_router = build_router(session_ref);
29+
let host_and_port = std::env::var("HOST_AND_PORT").unwrap_or("0.0.0.0:9881".to_string());
30+
let listener = tokio::net::TcpListener::bind(&host_and_port).await.unwrap();
31+
32+
info!("starting status service on http://{host_and_port}");
33+
axum::serve(listener, status_router).await.unwrap();
34+
}
35+
```
36+
37+
For a full example, check out
38+
the [simple-new-order](https://github.com/Validus-Risk-Management/hotfix/tree/main/examples/simple-new-order)
39+
sample application.

crates/hotfix-status/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
mod api;
22
mod data_provider;
3+
#[cfg(feature = "ui")]
34
mod error;
45
#[cfg(feature = "ui")]
56
mod ui;
@@ -29,5 +30,7 @@ pub fn build_router<M: FixMessage>(session_ref: SessionRef<M>) -> Router {
2930
pub fn build_router<M: FixMessage>(session_ref: SessionRef<M>) -> Router {
3031
let data_provider = SessionDataProvider { session_ref };
3132
let state = AppState { data_provider };
32-
Router::new().nest("/api", build_api_router(state))
33+
Router::new()
34+
.nest("/api", build_api_router())
35+
.with_state(state)
3336
}

crates/utils/Cargo.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

crates/utils/src/update_version.rs

Lines changed: 0 additions & 84 deletions
This file was deleted.

publish.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)