func (c *Cache) Add(index uint64, obj interface{}) bool {
	return c.getShard(index).add(index, obj)
}
Returns true if object already existed, false otherwise.
package cache
import (
	"sync"
)
const (
	shardsCount int = 32
)
type Cache []*cacheShard
func NewCache(maxSize int) Cache {
	if maxSize < shardsCount {
		maxSize = shardsCount
	}
	cache := make(Cache, shardsCount)
	for i := 0; i < shardsCount; i++ {
		cache[i] = &cacheShard{
			items:   make(map[uint64]interface{}),
			maxSize: maxSize / shardsCount,
		}
	}
	return cache
}
func (c Cache) getShard(index uint64) *cacheShard {
	return c[index%uint64(shardsCount)]
}