gitee.com/liuxuezhan/go-micro-v1.18.0@v1.0.0/registry/cache/options.go (about)

     1  package cache
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // WithTTL sets the cache TTL
     8  func WithTTL(t time.Duration) Option {
     9  	return func(o *Options) {
    10  		o.TTL = t
    11  	}
    12  }