func NewPathCache(size int) *PathCache {
	c := &PathCache{id: 1}
	cache, err := lru.NewWithEvict(size, c.onEvicted)
	if err != nil {
		panic(err)
	}
	c.cache = cache
	return c
}
NewPathCache builds a path cache.
package encoder
import (
	"github.com/hashicorp/golang-lru"
	"github.com/rgraphql/magellan/resolver"
	"sync"
)
type PathCache struct {
	idLock sync.Mutex
	id     uint32
	cache  *lru.Cache
}