forked from bitfinexcom/bitfinex-api-go
/
parameters.go
42 lines (36 loc) · 1.06 KB
/
parameters.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
package websocket
import (
"github.com/op/go-logging"
"time"
)
// Parameters defines adapter behavior.
type Parameters struct {
AutoReconnect bool
ReconnectInterval time.Duration
ReconnectAttempts int
reconnectTry int
ShutdownTimeout time.Duration
CapacityPerConnection int
Logger *logging.Logger
ResubscribeOnReconnect bool
HeartbeatTimeout time.Duration
LogTransport bool
URL string
ManageOrderbook bool
}
func NewDefaultParameters() *Parameters {
return &Parameters{
AutoReconnect: true,
CapacityPerConnection: 25,
ReconnectInterval: time.Second * 3,
reconnectTry: 0,
ReconnectAttempts: 15,
URL: productionBaseURL,
ManageOrderbook: false,
ShutdownTimeout: time.Second * 5,
ResubscribeOnReconnect: true,
HeartbeatTimeout: time.Second * 30,
LogTransport: false, // log transport send/recv
Logger: logging.MustGetLogger("bitfinex-ws"),
}
}