Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FindAndDel ¶
Find and delete string s in string slice
Types ¶
type WikiCache ¶
type WikiCache struct { Memory map[string]models.RequestResult // Map store request result HashedKeyQueue []string // Key queue. Delete the first item if reach max cache CreatedTime map[string]time.Time // Map store created time }
Cache to store Wikipedia request result
func MakeWikiCache ¶
func MakeWikiCache() WikiCache
Create a cache that store:
- Key: API request URL
- Value: RequestResponse
func (*WikiCache) Add ¶
func (cache *WikiCache) Add(s string, res models.RequestResult)
Add cache into the WikiCache
Click to show internal directories.
Click to hide internal directories.