(k string)
| 54 | } |
| 55 | |
| 56 | func (wc *WatchCacheStore) Get(k string) (interface{}, error) { |
| 57 | if !wc.available { |
| 58 | return nil, ErrorCacheNotAvilable |
| 59 | } |
| 60 | value, ok := wc.cache.Get(k) |
| 61 | if !ok { |
| 62 | return nil, errors.New("watch cache not have this key") |
| 63 | } |
| 64 | return value, nil |
| 65 | } |
| 66 | |
| 67 | func (wc *WatchCacheStore) Set(k string, x interface{}, d time.Duration) error { |
| 68 | if !wc.available { |