forked from perlin-network/noise
-
Notifications
You must be signed in to change notification settings - Fork 1
/
params.go
41 lines (30 loc) · 815 Bytes
/
params.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
package noise
import (
"time"
"github.com/cynthiatong/noise/identity"
"github.com/cynthiatong/noise/nat"
"github.com/cynthiatong/noise/transport"
)
type parameters struct {
Host string
Port, ExternalPort uint16
NAT nat.Provider
Keys identity.Keypair
Transport transport.Layer
Metadata map[string]interface{}
MaxMessageSize uint64
SendMessageTimeout time.Duration
ReceiveMessageTimeout time.Duration
SendWorkerBusyTimeout time.Duration
}
func DefaultParams() parameters {
return parameters{
Host: "127.0.0.1",
Transport: transport.NewTCP(),
Metadata: map[string]interface{}{},
MaxMessageSize: 1048576,
SendMessageTimeout: 3 * time.Second,
ReceiveMessageTimeout: 3 * time.Second,
SendWorkerBusyTimeout: 3 * time.Second,
}
}