forked from hyperledger/fabric-sdk-go
/
events.go
executable file
·39 lines (32 loc) · 1.03 KB
/
events.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
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package dispatcher
import (
pb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer"
)
// RegisterInterestsEvent registers interests with the event hub
type RegisterInterestsEvent struct {
Interests []*pb.Interest
ErrCh chan<- error
}
// NewRegisterInterestsEvent returns a RegisterInterests event
func NewRegisterInterestsEvent(interests []*pb.Interest, errch chan<- error) *RegisterInterestsEvent {
return &RegisterInterestsEvent{
Interests: interests,
ErrCh: errch,
}
}
// UnregisterInterestsEvent unregisters interests with the event hub
type UnregisterInterestsEvent struct {
Interests []*pb.Interest
ErrCh chan<- error
}
// NewUnregisterInterestsEvent returns an UnregisterInterests event
func NewUnregisterInterestsEvent(interests []*pb.Interest, errch chan<- error) *UnregisterInterestsEvent {
return &UnregisterInterestsEvent{
Interests: interests,
ErrCh: errch,
}
}