/
common.go
51 lines (42 loc) · 1017 Bytes
/
common.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
46
47
48
49
50
51
package gateway
import (
"time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/venus/venus-shared/types"
)
type RequestEvent struct {
ID types.UUID `json:"Id"`
Method string
Payload []byte
CreateTime time.Time `json:"-"`
Result chan *ResponseEvent `json:"-"`
}
type ResponseEvent struct {
ID types.UUID `json:"Id"`
Payload []byte
Error string
}
type ConnectionStates struct {
Connections []*ConnectState
ConnectionCount int
}
type ConnectState struct {
Addrs []address.Address
ChannelID types.UUID `json:"ChannelId"`
IP string `json:"Ip"`
RequestCount int
CreateTime time.Time
}
type ConnectedCompleted struct {
ChannelId types.UUID // nolint
}
type HostKey string
const (
HostUnknown HostKey = ""
HostMessager HostKey = "MESSAGER"
HostDroplet HostKey = "DROPLET"
HostNode HostKey = "VENUS"
HostAuth HostKey = "AUTH"
HostMiner HostKey = "MINER"
HostGateway HostKey = "GATEWAY"
)