func (s *Storage) Store(id string, bytes []byte) error {
	s.lock.RLock()
	if _, exists := s.chunks[id]; exists {
		s.stack.Touch(id)
		s.lock.RUnlock()
		return nil
	}
	s.lock.RUnlock()
	s.lock.Lock()
	var chunk []byte
	deleteID := s.stack.Pop()
	if "" != deleteID {
		chunk = s.chunks[deleteID]
		delete(s.chunks, deleteID)
		Log.Debugf("Deleted chunk %v", deleteID)
	} else {
		chunk = make([]byte, s.ChunkSize)
	}
	copy(chunk, bytes)
	s.chunks[id] = chunk
	s.stack.Push(id)
	s.lock.Unlock()
	return nil
}
Store stores a chunk in the RAM and adds it to the disk storage queue
package chunk
import (
	"errors"
	"sync"
	. "github.com/claudetech/loggo/default"
)
var ErrTimeout = errors.New("timeout")
type Storage struct {
	ChunkSize int64
	MaxChunks int
	chunks    map[string][]byte
	stack     *Stack
	lock      sync.RWMutex
}
type Item struct {
	id    string
	bytes []byte
}
func NewStorage(chunkSize int64, maxChunks int) *Storage {
	storage := Storage{
		ChunkSize: chunkSize,
		MaxChunks: maxChunks,
		chunks:    make(map[string][]byte),
		stack:     NewStack(maxChunks),
	}
	return &storage
}
func (s *Storage) Clear() error {
	return nil
}
func (s *Storage) Load(id string) []byte {
	s.lock.RLock()
	if chunk, exists := s.chunks[id]; exists {
		s.stack.Touch(id)
		s.lock.RUnlock()
		return chunk
	}
	s.lock.RUnlock()
	return nil
}