mirror of
https://github.com/go-i2p/goSam.git
synced 2025-07-13 14:18:25 -04:00
added reduce-on-idle and close-on-idle options (closes #9)
This commit is contained in:
12
client.go
12
client.go
@ -29,6 +29,13 @@ type Client struct {
|
||||
dontPublishLease bool
|
||||
encryptLease bool
|
||||
|
||||
reduceIdle bool
|
||||
reduceIdleTime uint
|
||||
reduceIdleQuantity uint
|
||||
|
||||
closeIdle bool
|
||||
closeIdleTime uint
|
||||
|
||||
debug bool
|
||||
}
|
||||
|
||||
@ -57,6 +64,11 @@ func NewClientFromOptions(opts ...func(*Client) error) (*Client, error) {
|
||||
c.outBackups = 2
|
||||
c.dontPublishLease = true
|
||||
c.encryptLease = false
|
||||
c.reduceIdle = false
|
||||
c.reduceIdleTime = 300000
|
||||
c.reduceIdleQuantity = 4
|
||||
c.closeIdle = true
|
||||
c.closeIdleTime = 600000
|
||||
c.debug = false
|
||||
for _, o := range opts {
|
||||
if err := o(&c); err != nil {
|
||||
|
Reference in New Issue
Block a user