MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / Get

Method Get

pkg/util/cache/watch_cache.go:56–65  ·  view source on GitHub ↗
(k string)

Source from the content-addressed store, hash-verified

54}
55
56func (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
67func (wc *WatchCacheStore) Set(k string, x interface{}, d time.Duration) error {
68 if !wc.available {

Callers

nothing calls this directly

Calls 2

NewMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected