-
Notifications
You must be signed in to change notification settings - Fork 0
/
context.go
45 lines (35 loc) · 1.12 KB
/
context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package context
import (
"github.com/hellobchain/fabric-sdk-go/pkg/common/providers/core"
"github.com/hellobchain/fabric-sdk-go/pkg/common/providers/fab"
"github.com/hellobchain/fabric-sdk-go/pkg/common/providers/msp"
)
// Client supplies the configuration and signing identity to client objects.
type Client fab.ClientContext
// Providers represents the SDK configured providers context.
type Providers interface {
core.Providers
msp.Providers
fab.Providers
}
// Local supplies the configuration for a local context client
type Local interface {
Client
LocalDiscoveryService() fab.DiscoveryService
}
// Channel supplies the configuration for channel context client
type Channel interface {
Client
ChannelService() fab.ChannelService
ChannelID() string
}
// ClientProvider returns client context
type ClientProvider func() (Client, error)
// LocalProvider returns local client context
type LocalProvider func() (Local, error)
// ChannelProvider returns channel client context
type ChannelProvider func() (Channel, error)