1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-18 08:26:38 +02:00
go-micro/registry/cache/options.go

22 lines
307 B
Go
Raw Normal View History

2019-05-31 01:22:43 +02:00
package cache
import (
"time"
2024-06-04 22:40:43 +02:00
"go-micro.dev/v5/logger"
2019-05-31 01:22:43 +02:00
)
2022-09-30 16:27:07 +02:00
// WithTTL sets the cache TTL.
2019-05-31 01:22:43 +02:00
func WithTTL(t time.Duration) Option {
return func(o *Options) {
o.TTL = t
}
}
2022-09-30 16:27:07 +02:00
// WithLogger sets the underline logger.
func WithLogger(l logger.Logger) Option {
return func(o *Options) {
o.Logger = l
}
}