1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/selector/registry/options.go
2018-12-29 15:44:51 +00:00

19 lines
329 B
Go

package registry
import (
"context"
"time"
"github.com/micro/go-micro/selector"
)
// Set the registry cache ttl
func TTL(t time.Duration) selector.Option {
return func(o *selector.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, "selector_ttl", t)
}
}