Created
October 16, 2016 14:38
-
-
Save s4l1h/4e9c36ee4ca430f7ad0b7062b4f7f109 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GetirOnu fonksiyonu gördüğünüz gibi ilk parametre olarak cache key alıyor | |
fakat ikinci parametre MemoryCache olmalı. | |
Redis yada memcache'e uyarlamak istediğinizde projedeki tüm MemoryCache yazan satırları değişmeniz gerekir | |
GetirOnu fonksiyonunu sadece MemoryCache ile çalışıyor. | |
*/ | |
func GetirOnu(key string,cache *MemoryCache) (string,error]){ | |
value, err := cache.Get(key) | |
if err != nil { | |
fmt.Println("Hata Oluştu : ", err) | |
return "",error | |
} | |
return string(value),nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment