Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit aeef71d

Browse files
committed
[FAB-5119] Split up API interfaces into multiple pkg
Change-Id: I9143176a2b06fff2350cb07ac45ec63b355f44dd Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent 73df8f6 commit aeef71d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+436
-403
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mock-gen:
5252
go get -u github.com/golang/mock/gomock
5353
go get -u github.com/golang/mock/mockgen
5454
mockgen -build_flags '$(LDFLAGS)' github.com/hyperledger/fabric-sdk-go/api/apitxn ProposalProcessor | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" > api/apitxn/mocks/mockapitxn.gen.go
55-
mockgen -build_flags '$(LDFLAGS)' github.com/hyperledger/fabric-sdk-go/api Config | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" > api/mocks/mockconfig.gen.go
55+
mockgen -build_flags '$(LDFLAGS)' github.com/hyperledger/fabric-sdk-go/api/apiconfig Config | sed "s/github.com\/hyperledger\/fabric-sdk-go\/vendor\///g" > api/apiconfig/mocks/mockconfig.gen.go
5656

5757
clean:
5858
rm -Rf /tmp/enroll_user /tmp/msp /tmp/keyvaluestore

api/config.go renamed to api/apiconfig/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apiconfig
88

99
import (
1010
"crypto/x509"
Lines changed: 15 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/network.go renamed to api/apiconfig/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apiconfig
88

99
// NetworkConfig provides a static definition of a Hyperledger Fabric network
1010
type NetworkConfig struct {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apifabca
88

99
import (
1010
"github.com/hyperledger/fabric/bccsp"

api/user.go renamed to api/apifabca/user.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apifabca
88

99
import (
1010
"github.com/hyperledger/fabric/bccsp"
@@ -27,16 +27,12 @@ import (
2727
type User interface {
2828
Name() string
2929
Roles() []string
30-
SetRoles([]string)
31-
SetMspID(mspID string)
3230
MspID() string
3331

3432
// ECerts
3533
EnrollmentCertificate() []byte
36-
SetEnrollmentCertificate(cert []byte)
37-
SetPrivateKey(privateKey bccsp.Key)
3834
PrivateKey() bccsp.Key
3935

40-
// TCerts
41-
GenerateTcerts(count int, attributes []string)
36+
// TODO: TCerts
37+
//GenerateTcerts(count int, attributes []string)
4238
}

api/channel.go renamed to api/apifabclient/channel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apifabclient
88

99
import (
1010
txn "github.com/hyperledger/fabric-sdk-go/api/apitxn"

api/event.go renamed to api/apifabclient/event.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apifabclient
88

99
import (
1010
common "github.com/hyperledger/fabric/protos/common"
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apifabclient
88

99
import (
10+
config "github.com/hyperledger/fabric-sdk-go/api/apiconfig" // TODO: Think about package hierarchy
1011
txn "github.com/hyperledger/fabric-sdk-go/api/apitxn"
1112
"github.com/hyperledger/fabric/bccsp"
1213
"github.com/hyperledger/fabric/protos/common"
@@ -49,7 +50,7 @@ type FabricClient interface {
4950
GetIdentity() ([]byte, error)
5051
GetUserContext() User
5152
SetUserContext(user User)
52-
GetConfig() Config
53+
GetConfig() config.Config // TODO: refactor to a fab client config interface
5354
}
5455

5556
// CreateChannelRequest requests channel creation on the network
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
44
SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
package api
7+
package apifabclient
88

99
// KeyValueStore ...
1010
/**

0 commit comments

Comments
 (0)