func (ks *InMemoryStorage) List() []*storage.MetaDataObj {
	return ks.collection.List()
}
List the items in the collection
package inmemory
import (
	"errors"
	"time"
	"github.com/maxzerbini/ovo/storage"
)
type InMemoryStorage struct {
	collection *InMemoryMutexCollection
	cleaner    *Cleaner
}
func NewInMemoryStorage() *InMemoryStorage {
	ks := new(InMemoryStorage)
	ks.collection = NewMutexCollection()
	ks.cleaner = NewCleaner(ks, 60)
	return ks
}
func (ks *InMemoryStorage) Put(obj *storage.MetaDataObj) error {
	if obj != nil {
		if len(obj.Key) == 0 {
			return errors.New("Object key is null.")
		}
		if len(obj.Collection) == 0 {
			obj.Collection = "default"
		}
		obj.CreationDate = time.Now()
		ks.collection.Put(obj)
		if obj.TTL > 0 {
			go ks.cleaner.AddElement(obj)
		}
	}
	return errors.New("Object is null.")
}
func (ks *InMemoryStorage) Get(key string) (*storage.MetaDataObj, error) {
	if obj, ok := ks.collection.Get(key); ok {
		if obj.IsExpired() {
			return nil, errors.New("Not found.")
		}
		return obj, nil
	}
	return nil, errors.New("Not found.")
}
func (ks *InMemoryStorage) Delete(key string) {
	ks.collection.Delete(key)
}
func (ks *InMemoryStorage) DeleteExpired(key string) {
	ks.collection.DeleteExpired(key)
}
func (ks *InMemoryStorage) GetAndRemove(key string) (*storage.MetaDataObj, error) {
	if obj, ok := ks.collection.GetAndRemove(key); ok {
		if obj.IsExpired() {
			return nil, errors.New("Not found.")
		}
		return obj, nil
	}
	return nil, errors.New("Not found.")
}
func (ks *InMemoryStorage) UpdateValueIfEqual(obj *storage.MetaDataUpdObj) error {
	if obj != nil {
		if len(obj.Key) == 0 {
			return errors.New("Object key is null.")
		}
		if len(obj.Collection) == 0 {
			obj.Collection = "default"
		}
		obj.CreationDate = time.Now()
		if ks.collection.UpdateValueIfEqual(obj) {
			return nil
		} else {
			return errors.New("Objects are not equal.")
		}
	}
	return errors.New("Object is null.")
}
func (ks *InMemoryStorage) UpdateKeyAndValueIfEqual(obj *storage.MetaDataUpdObj) error {
	if obj != nil {
		if len(obj.Key) == 0 {
			return errors.New("Object key is null.")
		}
		if len(obj.NewKey) == 0 {
			return errors.New("Object new key is null.")
		}
		if len(obj.Collection) == 0 {
			obj.Collection = "default"
		}
		obj.CreationDate = time.Now()
		if ks.collection.UpdateKeyAndValueIfEqual(obj) {
			return nil
		} else {
			return errors.New("Objects are not equal.")
		}
	}
	return errors.New("Object is null.")
}
func (ks *InMemoryStorage) UpdateKey(obj *storage.MetaDataUpdObj) error {
	if obj != nil {
		if len(obj.Key) == 0 {
			return errors.New("Object key is null.")
		}
		if len(obj.NewKey) == 0 {
			return errors.New("Object new key is null.")
		}
		if len(obj.Collection) == 0 {
			obj.Collection = "default"
		}
		obj.CreationDate = time.Now()
		ks.collection.UpdateKey(obj)
		return nil
	}
	return errors.New("Object is null.")
}
func (ks *InMemoryStorage) Touch(key string) {
	ks.collection.Touch(key, time.Now())
}
func (ks *InMemoryStorage) Count() int {
	return ks.collection.Count()
}