Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Set used to save in the cache the status code and the content of the URL Set(URL string, statusCode int, content []byte) error // Get used to get back data from the cache Get(URL string) (int, []byte, error) // Clear removes all records from the cache Clear() error }
Cache interface used to store locally and temporarily pages downloaded from Linguee. Made to reduce the load on Linguee servers and to speed up the API.
type DBCache ¶
DBCache is an object which implements the cache interface, and stores data in a database in compressed format
type MemoryCache ¶
type MemoryCache map[string]memoryCacheItem
MemoryCache is an object which implements the cache interface and stores data in memory (dummy implementation: use in production with care, since never releases the cache, prone to memory leaks)
func (MemoryCache) Clear ¶
func (c MemoryCache) Clear() error
Clear removes all records from the cache
Click to show internal directories.
Click to hide internal directories.