1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-17 17:44:30 +02:00
go-micro/util/pool/options.go

34 lines
437 B
Go
Raw Normal View History

2019-07-28 18:56:18 +01:00
package pool
import (
"time"
2024-06-04 21:40:43 +01:00
"go-micro.dev/v5/transport"
2019-07-28 18:56:18 +01:00
)
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
}
}