mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-18 08:26:38 +02:00
22 lines
307 B
Go
22 lines
307 B
Go
package cache
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go-micro.dev/v4/logger"
|
|
)
|
|
|
|
// WithTTL sets the cache TTL.
|
|
func WithTTL(t time.Duration) Option {
|
|
return func(o *Options) {
|
|
o.TTL = t
|
|
}
|
|
}
|
|
|
|
// WithLogger sets the underline logger.
|
|
func WithLogger(l logger.Logger) Option {
|
|
return func(o *Options) {
|
|
o.Logger = l
|
|
}
|
|
}
|