Skip to content

Commit

Permalink
Expose NodeEvent to public API (#643)
Browse files Browse the repository at this point in the history
* Expose NodeEvent to public API

* Add entry to CHANGELOG.md
  • Loading branch information
adzialocha committed Jun 26, 2024
1 parent 154846c commit ea542c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Expose NodeEvent to public API [#643](https://github.com/p2panda/aquadoggo/pull/643)

## [0.8.0]

### Added
Expand Down
4 changes: 4 additions & 0 deletions aquadoggo/src/api/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ use crate::api::{migrate, LockFile};
use crate::bus::{ServiceMessage, ServiceSender};
use crate::context::Context;

/// Node events which can be interesting for clients, for example when peers connect or disconnect.
#[derive(Debug, Clone)]
pub enum NodeEvent {
/// A peer connected to our node. This can be a direct or relayed connection.
PeerConnected,

/// A peer disconnected from our node.
PeerDisconnected,
}

Expand Down
2 changes: 1 addition & 1 deletion aquadoggo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod tests;

use log::{info, log_enabled, Level};

pub use crate::api::{ConfigFile, LockFile};
pub use crate::api::{ConfigFile, LockFile, NodeEvent};
pub use crate::config::{AllowList, Configuration};
pub use crate::network::{NetworkConfiguration, Transport};
pub use node::Node;
Expand Down

0 comments on commit ea542c8

Please sign in to comment.