March 2019
Intermediate to advanced
336 pages
9h 9m
English
The main method creates the cache by invoking the NewCache method. The key and value are set on the cache by invoking setValue. The value is accessed by calling the GetObject method of the Cache class. This is shown in the following code:
// main methodfunc main() { var cache *Cache cache = NewCache() cache.SetValue("name", "john smith", 200000000) var name string name = cache.GetObject("name") fmt.Println(name)}
Run the following command to execute the cache_management.go file:
go run cache_management.go
The output is as follows:

The next section talks about the space allocation algorithm.
Read now
Unlock full access