You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zero/core/stores/cache/cacheopt.go

22 lines
329 B
Go

4 years ago
package cache
import (
"time"
"zero/core/stores/internal"
)
type Option = internal.Option
func WithExpiry(expiry time.Duration) Option {
return func(o *internal.Options) {
o.Expiry = expiry
}
}
func WithNotFoundExpiry(expiry time.Duration) Option {
return func(o *internal.Options) {
o.NotFoundExpiry = expiry
}
}