func (c *Cache) ClearCache() (err error) {
	c.Lock()
	err = c.repo.Clear()
	c.Unlock()
	return
}
ClearCache ...
TODO: (bxcodec)
Add Test for this function
package gotcha
import (
	"sync"
	"time"
	"github.com/bxcodec/gotcha/cache"
	"github.com/bxcodec/gotcha/internal"
	"github.com/bxcodec/gotcha/internal/lfu"
	"github.com/bxcodec/gotcha/internal/lru"
)
var (
	DefaultCache = New()
)
func New(options ...*cache.Option) (c cache.Cache) {
	option := mergeOptions(options...)
	if option.MaxSizeItem == 0 {
		option.MaxSizeItem = cache.DefaultSize
	}
	if option.AlgorithmType == "" {
		option.AlgorithmType = cache.LRUAlgorithm
	}
	if option.ExpiryTime == 0 {
		option.ExpiryTime = cache.DefaultExpiryTime
	}
	c = &Cache{
		repo: NewRepository(*option),
	}
	return
}
func NewOption() (op *cache.Option) {
	return &cache.Option{}
}
func mergeOptions(options ...*cache.Option) (opts *cache.Option) {
	opts = new(cache.Option)
	for _, op := range options {
		if op.AlgorithmType != "" {
			opts.AlgorithmType = op.AlgorithmType
		}
		if op.ExpiryTime != 0 {
			opts.ExpiryTime = op.ExpiryTime
		}
		if op.MaxMemory != 0 {
			opts.MaxMemory = op.MaxMemory
		}
		if op.MaxSizeItem != 0 {
			opts.MaxSizeItem = op.MaxSizeItem
		}
	}
	return
}
func Set(key string, value interface{}) (err error) {
	return DefaultCache.Set(key, value)
}
func Get(key string) (value interface{}, err error) {
	return DefaultCache.Get(key)
}
func Delete(key string) (err error) {
	return DefaultCache.Delete(key)
}
func GetKeys() (keys []string, err error) {
	return DefaultCache.GetKeys()
}
func ClearCache() (err error) {
	return DefaultCache.ClearCache()
}
func NewRepository(option cache.Option) internal.Repository {
	var repo internal.Repository
	switch option.AlgorithmType {
	case cache.LRUAlgorithm:
		repo = lru.New(option.MaxSizeItem, option.MaxMemory, option.ExpiryTime)
	case cache.LFUAlgorithm:
		repo = lfu.New(option.MaxSizeItem, option.MaxMemory, option.ExpiryTime)
	}
	return repo
}
type Cache struct {
	sync.RWMutex
	repo internal.Repository
}
func (c *Cache) Set(key string, value interface{}) (err error) {
	document := &cache.Document{
		Key:        key,
		Value:      value,
		StoredTime: time.Now().Unix(),
	}
	c.Lock()
	c.repo.Set(document)
	c.Unlock()
	return
}
func (c *Cache) Get(key string) (value interface{}, err error) {
	c.RLock()
	doc, err := c.repo.Get(key)
	c.RUnlock()
	if err != nil {
		return
	}
	value = doc.Value
	return
}
func (c *Cache) Delete(key string) (err error) {
	c.Lock()
	_, err = c.repo.Delete(key)
	c.Unlock()
	if err != nil {
		return
	}
	return
}
func (c *Cache) GetKeys() (keys []string, err error) {
	c.RLock()
	keys, err = c.repo.Keys()
	c.RUnlock()
	return
}