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
352 B
Go

package cache
import (
"time"
"github.com/tal-tech/go-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
}
}