forked from renproject/aw
-
Notifications
You must be signed in to change notification settings - Fork 1
/
aw.go
74 lines (65 loc) · 1.9 KB
/
aw.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package aw
import (
"github.com/renproject/aw/dht"
"github.com/renproject/aw/handshake"
"github.com/renproject/aw/peer"
"github.com/renproject/aw/protocol"
"github.com/renproject/aw/tcp"
)
const (
V1 = protocol.V1
Ping = protocol.Ping
Pong = protocol.Pong
Cast = protocol.Cast
Multicast = protocol.Multicast
Broadcast = protocol.Broadcast
)
type (
// Messages
Message = protocol.Message
MessageOnTheWire = protocol.MessageOnTheWire
MessageLength = protocol.MessageLength
MessageVariant = protocol.MessageVariant
MessageVersion = protocol.MessageVersion
MessageBody = protocol.MessageBody
MessageSender = protocol.MessageSender
MessageReceiver = protocol.MessageReceiver
// Events
Event = protocol.Event
EventSender = protocol.EventSender
EventReceiver = protocol.EventReceiver
EventPeerChanged = protocol.EventPeerChanged
EventMessageReceived = protocol.EventMessageReceived
// Peers
Peer = peer.Peer
PeerOptions = peer.Options
PeerID = protocol.PeerID
PeerIDs = protocol.PeerIDs
GroupID = protocol.GroupID
PeerAddress = protocol.PeerAddress
PeerAddresses = protocol.PeerAddresses
PeerAddressCodec = protocol.PeerAddressCodec
// Network
DHT = dht.DHT
Client = protocol.Client
Server = protocol.Server
Session = protocol.Session
SessionManager = protocol.SessionManager
SignVerifier = protocol.SignVerifier
Handshaker = handshake.Handshaker
// Options
TCPConnPoolOptions = tcp.ConnPoolOptions
TCPServerOptions = tcp.ServerOptions
)
// Default values
var NilGroupID = protocol.NilGroupID
// Constructors
var (
NewMessage = protocol.NewMessage
NewPeer = peer.New
NewDHT = dht.New
NewTCPPeer = peer.NewTCP
NewConnPool = tcp.NewConnPool
NewTCPClient = tcp.NewClient
NewTCPServer = tcp.NewServer
)