github.com/bitfinexcom/bitfinex-api-go@v0.0.0-20210608095005-9e0b26f200fb/v2/websocket/parameters.go (about) 1 package websocket 2 3 import ( 4 "github.com/op/go-logging" 5 "time" 6 ) 7 8 // Parameters defines adapter behavior. 9 type Parameters struct { 10 AutoReconnect bool 11 ReconnectInterval time.Duration 12 ReconnectAttempts int 13 reconnectTry int 14 ShutdownTimeout time.Duration 15 CapacityPerConnection int 16 Logger *logging.Logger 17 18 ResubscribeOnReconnect bool 19 20 HeartbeatTimeout time.Duration 21 LogTransport bool 22 23 URL string 24 ManageOrderbook bool 25 } 26 27 func NewDefaultParameters() *Parameters { 28 return &Parameters{ 29 AutoReconnect: true, 30 CapacityPerConnection: 25, 31 ReconnectInterval: time.Second * 3, 32 reconnectTry: 0, 33 ReconnectAttempts: 15, 34 URL: productionBaseURL, 35 ManageOrderbook: false, 36 ShutdownTimeout: time.Second * 5, 37 ResubscribeOnReconnect: true, 38 HeartbeatTimeout: time.Second * 30, 39 LogTransport: false, // log transport send/recv 40 Logger: logging.MustGetLogger("bitfinex-ws"), 41 } 42 }