func NewGobMenuCacher(
	decay time.Duration,
	db cache.Storage,
	store func() *dawg.Store,
) MenuCacher {
	mc := &generalMenuCacher{
		m:          nil,
		db:         db,
		getstore:   store,
		newEncoder: func(w io.Writer) Encoder { return gob.NewEncoder(w) },
		newDecoder: func(r io.Reader) Decoder { return gob.NewDecoder(r) },
	}
	mc.Updater = cache.NewUpdater(decay, mc.cacheNewMenu, mc.getCachedMenu)
	return mc
}
NewGobMenuCacher will create a MenuCacher that will store the menu
in a binary format using the "encoding/gob" package.
package data
import (
	"bytes"
	"encoding/gob"
	"encoding/json"
	"io"
	"log"
	"time"
	"github.com/harrybrwn/apizza/dawg"
	"github.com/harrybrwn/apizza/pkg/cache"
	"github.com/harrybrwn/apizza/pkg/errs"
)
type MenuCacher interface {
	cache.Updater
	Menu() *dawg.Menu
}
func NewMenuCacher(
	decay time.Duration,
	db cache.Storage,
	store func() *dawg.Store,
) MenuCacher {
	return NewGobMenuCacher(decay, db, store)
}
func init() {
	gob.Register([]interface{}{})
}
type Encoder interface {
	Encode(interface{}) error
}
type Decoder interface {
	Decode(interface{}) error
}
type generalMenuCacher struct {
	cache.Updater
	m        *dawg.Menu
	db       cache.Storage
	getstore func() *dawg.Store
	newEncoder func(io.Writer) Encoder
	newDecoder func(io.Reader) Decoder
}
func NewJSONMenuCacher(
	decay time.Duration,
	db cache.Storage,
	store func() *dawg.Store,
) MenuCacher {
	mc := &generalMenuCacher{
		m:          nil,
		db:         db,
		getstore:   store,
		newEncoder: func(w io.Writer) Encoder { return json.NewEncoder(w) },
		newDecoder: func(r io.Reader) Decoder { return json.NewDecoder(r) },
	}
	mc.Updater = cache.NewUpdater(decay, mc.cacheNewMenu, mc.getCachedMenu)
	return mc
}