// Retrieve method are retrieves cached value from the cache using its key.
// If value is missing in the cache or expired it returns nil.
// Parameters:
//   - correlationId     (optional) transaction id to trace execution through call chain.
//   - key               a unique value key.
// Retruns value *memcache.Item, err error
// cached value or error.
Retrieve method are retrieves cached value from the cache using its key.
If value is missing in the cache or expired it returns nil.
Parameters:
- correlationId     (optional) transaction id to trace execution through call chain.
- key               a unique value key.
Retruns value *memcache.Item, err error
cached value or error.
// Retrieve method are retrieves cached value from the cache using its key . // If value is missing in the cache or expired it returns nil . // Parameters : // - correlationId ( optional ) transaction id to trace execution through call chain . // - key a unique value key . // Retruns value * memcache . Item err error // cached value or error .
func (c *MemcachedCache) RetrieveAs(correlationId string, key string, result interface{}) (value interface{}, err error) {
	state, err := c.checkOpened(correlationId)
	if !state {
		return nil, err
	}
	item, err := c.client.Get(key)
	if err != nil && err == memcache.ErrCacheMiss {
		err = nil
	}
	if item != nil {
		err = json.Unmarshal(item.Value, result)
		if err != nil {
			return nil, err
		}
		return result, nil
	}
	return nil, err
}
func ( c * MemcachedCache ) RetrieveAs ( correlationId string , key string , result interface { } ) ( value interface { } , err error ) { state , err := c . checkOpened ( correlationId ) if ! state { return nil , err } item , err := c . client . Get ( key ) if err != nil && err == memcache . ErrCacheMiss { err = nil } if item != nil { err = json . Unmarshal ( item . Value , result ) if err != nil { return nil , err } return result , nil } return nil , err }
Retrieve method are retrieves cached value from the cache using its key.
Retrieve method are retrieves cached value from the cache using its key .