forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
context.go
38 lines (30 loc) · 1.05 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
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package fab
import (
reqContext "context"
"github.com/hyperledger/fabric-sdk-go/pkg/common/options"
)
// ChannelService supplies services related to a channel.
type ChannelService interface {
Config() (ChannelConfig, error)
EventService(opts ...options.Opt) (EventService, error)
Membership() (ChannelMembership, error)
ChannelConfig() (ChannelCfg, error)
Transactor(reqCtx reqContext.Context) (Transactor, error)
Discovery() (DiscoveryService, error)
Selection() (SelectionService, error)
}
// Transactor supplies methods for sending transaction proposals and transactions.
type Transactor interface {
Sender
ProposalSender
}
// ChannelProvider supplies Channel related-objects for the named channel.
type ChannelProvider interface {
ChannelService(ctx ClientContext, channelID string) (ChannelService, error)
}
// ErrorHandler is invoked when an error occurs in one of the services
type ErrorHandler func(ctxt ClientContext, channelID string, err error)