1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +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"
"go-micro.dev/v4/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
}
}