-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-7625] Make core fabric generic in fabapi
This patch changes the core fabric methods to use a provider interface. Additionally the provider factory is split into core and services and moved out of fabapi. Missing unit tests of the default factories are also added. Change-Id: Ie5c04f14fbc03cfc8eefa93878a7f2f7582e160f Signed-off-by: Troy Ronda <[email protected]>
- Loading branch information
Showing
29 changed files
with
1,345 additions
and
484 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package apicore | ||
|
||
import ( | ||
"github.com/hyperledger/fabric-sdk-go/api/apiconfig" | ||
"github.com/hyperledger/fabric-sdk-go/api/apifabclient" | ||
) | ||
|
||
// FabricProvider allows overriding of fabric objects such as peer and user | ||
type FabricProvider interface { | ||
NewClient(user apifabclient.User) (apifabclient.FabricClient, error) | ||
NewPeer(url string, certificate string, serverHostOverride string) (apifabclient.Peer, error) | ||
NewPeerFromConfig(peerCfg *apiconfig.NetworkPeer) (apifabclient.Peer, error) | ||
// EnrollUser(orgID, name, pwd string) (apifabca.User, error) | ||
NewUser(name string, signingIdentity *apifabclient.SigningIdentity) (apifabclient.User, error) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.