-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement an abstract event client that connects to a GRPC event server and manages the connection/stream. This client may be extended by protocol-specific implementations (i.e. Event Hub and Deliver Service). Also moved files to new package structure. Change-Id: I489fd7e6c5780fda2e43412c8aadf732343b8e36 Signed-off-by: Bob Stasyszyn <Bob.Stasyszyn@securekey.com>
- Loading branch information
1 parent
f0853f3
commit 36f1d9d
Showing
34 changed files
with
3,137 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package api | ||
|
||
import ( | ||
"github.com/hyperledger/fabric-sdk-go/pkg/context" | ||
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/fab" | ||
) | ||
|
||
// Connection defines the functions for an event server connection | ||
type Connection interface { | ||
// Receive sends events to the given channel | ||
Receive(chan<- interface{}) | ||
// Close closes the connection | ||
Close() | ||
// Closed return true if the connection is closed | ||
Closed() bool | ||
} | ||
|
||
// ConnectionProvider creates a Connection. | ||
type ConnectionProvider func(channelID string, context context.Context, peer fab.Peer) (Connection, error) |
Oops, something went wrong.