func NewImageCache(twAPI TwitterAPI, twitterID string, cacheCnt int) ImageCache { e := &imageCache{ cache: []string{}, twAPI: twAPI, rd: rand.New(rand.NewSource(time.Now().UnixNano())), twitterID: twitterID, cacheCnt: cacheCnt, } e.Expire = expcache.NewExpireMemoryCache(e, 24*time.Hour) return e }
func NewExampleDataCache(refreshCycle time.Duration) ExampleData { e := &exampleData{cache: []byte{}} e.Expire = expcache.NewExpireMemoryCache(e, refreshCycle) return e }
func NewTestCache(date time.Time) *TestCache { e := &TestCache{cache: []byte{}} e.Expire = expcache.NewExpireMemoryCache(e, dataRefreshCycle) e.date = date return e }
func NewExampleDataCache() ExampleData { e := &exampleData{cache: Hoge{}} e.Expire = expcache.NewExpireMemoryCache(e, 15*time.Minute) return e }