func NewTimedcache(ttl time.Duration, getter GetFunc) (*TimedCache, error) {
	if getter == nil {
		return nil, fmt.Errorf("getter is not provided")
	}

	return &TimedCache{
		Getter: getter,
		// switch to using NewStore instead of NewTTLStore so that we can
		// reuse entries for calls that are fine with reading expired/stalled data.
		// with NewTTLStore, entries are not returned if they have already expired.
		Store: cache.NewStore(cacheKeyFunc),
		TTL:   ttl,
	}, nil
}
// NewTimedcache creates a new TimedCache.
NewTimedcache creates a new TimedCache.
// NewTimedcache creates a new TimedCache .
func NewTimedcache(ttl time.Duration, getter GetFunc) (*TimedCache, error) {
	if getter == nil {
		return nil, fmt.Errorf("getter is not provided")
	}
	return &TimedCache{
		Getter: getter,
		Store: cache.NewStore(cacheKeyFunc),
		TTL:   ttl,
	}, nil
}
func NewTimedcache ( ttl time . Duration , getter GetFunc ) ( * TimedCache , error ) { if getter == nil { return nil , fmt . Errorf ( " " ) } return & TimedCache { Getter : getter , Store : cache . NewStore ( cacheKeyFunc ) , TTL : ttl , } , nil }
NewTimedcache creates a new TimedCache.
NewTimedcache creates a new TimedCache .
// switch to using NewStore instead of NewTTLStore so that we can // reuse entries for calls that are fine with reading expired/stalled data. // with NewTTLStore, entries are not returned if they have already expired.