|
1 | 1 | # whisper |
2 | 2 |
|
| 3 | +[](https://github.com/davidsbond/whisper/actions/workflows/go.yml) [](https://pkg.go.dev/github.com/davidsbond/whisper)  |
| 4 | + |
3 | 5 | A gRPC-based gossip protocol |
4 | 6 |
|
5 | 7 | ## About |
6 | 8 |
|
7 | 9 | `whisper` is a go package providing a simple gossip protocol mechanism that allows peers within a network to discover |
8 | | -each other and share metadata. It utilises UDP and ECDH for fast and secure convergence. It is heavily inspired by |
9 | | -[HashiCorp Serf](https://github.com/hashicorp/serf) and [Wireguard](https://www.wireguard.com/). |
| 10 | +each other and share metadata. It utilises UDP and ECDH for fast and secure convergence. It is inspired by technologies |
| 11 | +such as [HashiCorp Serf](https://github.com/hashicorp/serf) and [Wireguard](https://www.wireguard.com/). |
| 12 | + |
| 13 | +Whisper aims to provide a foundation for building distributed systems where automatic discovery of new nodes is |
| 14 | +applicable, with an emphasis on keeping information about your peers secure. |
10 | 15 |
|
11 | 16 | ### Joining |
12 | 17 |
|
@@ -101,16 +106,16 @@ within the network. |
101 | 106 | ```go |
102 | 107 | // The PeerStore interface describes types that can persist peer data. |
103 | 108 | PeerStore interface { |
104 | | - // FindPeer should return the peer.Peer whose identifier matches the one provided. It should return |
105 | | - // store.ErrPeerNotFound if a matching peer does not exist. |
106 | | - FindPeer(ctx context.Context, id uint64) (peer.Peer, error) |
107 | | - // SavePeer should persist the given peer.Peer. |
108 | | - SavePeer(ctx context.Context, peer peer.Peer) error |
109 | | - // ListPeers should return all peers within the store. |
110 | | - ListPeers(ctx context.Context) ([]peer.Peer, error) |
111 | | - // RemovePeer should remove a peer from the store. It should return store.ErrPeerNotFound if a matching |
112 | | - // peer does not exist. |
113 | | - RemovePeer(ctx context.Context, id uint64) error |
| 109 | +// FindPeer should return the peer.Peer whose identifier matches the one provided. It should return |
| 110 | +// store.ErrPeerNotFound if a matching peer does not exist. |
| 111 | +FindPeer(ctx context.Context, id uint64) (peer.Peer, error) |
| 112 | +// SavePeer should persist the given peer.Peer. |
| 113 | +SavePeer(ctx context.Context, peer peer.Peer) error |
| 114 | +// ListPeers should return all peers within the store. |
| 115 | +ListPeers(ctx context.Context) ([]peer.Peer, error) |
| 116 | +// RemovePeer should remove a peer from the store. It should return store.ErrPeerNotFound if a matching |
| 117 | +// peer does not exist. |
| 118 | +RemovePeer(ctx context.Context, id uint64) error |
114 | 119 | } |
115 | 120 | ``` |
116 | 121 |
|
|
0 commit comments