4
4
package ipcs
5
5
6
6
import (
7
- "nanomsg.org/go/mangos/v2"
8
- "nanomsg.org/go/mangos/v2/protocol/pub"
7
+ "go.nanomsg.org/mangos/v3/protocol/pub"
8
+
9
+ mangos "go.nanomsg.org/mangos/v3"
9
10
10
11
"github.com/ava-labs/gecko/ids"
11
12
"github.com/ava-labs/gecko/snow/triggers"
@@ -19,14 +20,14 @@ type chainEventDipatcher struct {
19
20
events * triggers.EventDispatcher
20
21
}
21
22
22
- // eventSockets is a set of named eventSockets
23
- type eventSockets struct {
23
+ // EventSockets is a set of named eventSockets
24
+ type EventSockets struct {
24
25
consensusSocket * eventSocket
25
26
decisionsSocket * eventSocket
26
27
}
27
28
28
29
// newEventSockets creates a *ChainIPCs with both consensus and decisions IPCs
29
- func newEventSockets (ctx context , chainID ids.ID , consensusEvents * triggers.EventDispatcher , decisionEvents * triggers.EventDispatcher ) (* eventSockets , error ) {
30
+ func newEventSockets (ctx context , chainID ids.ID , consensusEvents * triggers.EventDispatcher , decisionEvents * triggers.EventDispatcher ) (* EventSockets , error ) {
30
31
consensusIPC , err := newEventIPCSocket (ctx , chainID , ipcConsensusIdentifier , consensusEvents )
31
32
if err != nil {
32
33
return nil , err
@@ -37,14 +38,14 @@ func newEventSockets(ctx context, chainID ids.ID, consensusEvents *triggers.Even
37
38
return nil , err
38
39
}
39
40
40
- return & eventSockets {
41
+ return & EventSockets {
41
42
consensusSocket : consensusIPC ,
42
43
decisionsSocket : decisionsIPC ,
43
44
}, nil
44
45
}
45
46
46
47
// Accept delivers a message to the underlying eventSockets
47
- func (ipcs * eventSockets ) Accept (chainID , containerID ids.ID , container []byte ) error {
48
+ func (ipcs * EventSockets ) Accept (chainID , containerID ids.ID , container []byte ) error {
48
49
if ipcs .consensusSocket != nil {
49
50
if err := ipcs .consensusSocket .Accept (chainID , containerID , container ); err != nil {
50
51
return err
@@ -61,7 +62,7 @@ func (ipcs *eventSockets) Accept(chainID, containerID ids.ID, container []byte)
61
62
}
62
63
63
64
// stop closes the underlying eventSockets
64
- func (ipcs * eventSockets ) stop () error {
65
+ func (ipcs * EventSockets ) stop () error {
65
66
errs := wrappers.Errs {}
66
67
67
68
if ipcs .consensusSocket != nil {
@@ -76,12 +77,12 @@ func (ipcs *eventSockets) stop() error {
76
77
}
77
78
78
79
// ConsensusURL returns the URL of socket receiving consensus events
79
- func (ipcs * eventSockets ) ConsensusURL () string {
80
+ func (ipcs * EventSockets ) ConsensusURL () string {
80
81
return ipcs .consensusSocket .URL ()
81
82
}
82
83
83
84
// DecisionsURL returns the URL of socket receiving decisions events
84
- func (ipcs * eventSockets ) DecisionsURL () string {
85
+ func (ipcs * EventSockets ) DecisionsURL () string {
85
86
return ipcs .decisionsSocket .URL ()
86
87
}
87
88
0 commit comments