mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-12 08:23:58 +02:00
f23638c036
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
34 lines
450 B
Go
34 lines
450 B
Go
package pool
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/micro/go-micro/v2/transport"
|
|
)
|
|
|
|
type Options struct {
|
|
Transport transport.Transport
|
|
TTL time.Duration
|
|
Size int
|
|
}
|
|
|
|
type Option func(*Options)
|
|
|
|
func Size(i int) Option {
|
|
return func(o *Options) {
|
|
o.Size = i
|
|
}
|
|
}
|
|
|
|
func Transport(t transport.Transport) Option {
|
|
return func(o *Options) {
|
|
o.Transport = t
|
|
}
|
|
}
|
|
|
|
func TTL(t time.Duration) Option {
|
|
return func(o *Options) {
|
|
o.TTL = t
|
|
}
|
|
}
|