func (g *GlobImporter) CanProcess(path string) bool {
	return strings.HasPrefix(path, g.prefix)
}
CanProcess implements the interface method, returning true for paths that start with the string "glob:"
package importers
import (
	"bytes"
	"crypto/sha256"
	"encoding/base64"
	"fmt"
	"os"
	"path"
	"path/filepath"
	"sort"
	"strings"
	"github.com/bmatcuk/doublestar/v4"
	"github.com/google/go-jsonnet"
)
type globCacheKey struct {
	verb     string  
	resolved string  
	relative string  
}
var separator = []byte{0}
func (c globCacheKey) file(baseDir string) string {
	h := sha256.New()
	h.Write([]byte(c.verb))
	h.Write(separator)
	h.Write([]byte(c.resolved))
	h.Write(separator)
	h.Write([]byte(c.relative))
	baseName := base64.RawURLEncoding.EncodeToString(h.Sum(nil))
	fileName := fmt.Sprintf("%s-%s.glob", baseName, c.verb)
	return filepath.Join(baseDir, fileName)
}
type globEntry struct {
	contents jsonnet.Contents
	foundAt  string
	err      error
}
type GlobImporter struct {
	innerVerb string
	prefix    string
	cache     map[globCacheKey]*globEntry
}
func NewGlobImporter(innerVerb string) *GlobImporter {
	if !(innerVerb == "import" || innerVerb == "importstr") {
		panic("invalid inner verb " + innerVerb + " for glob importer")
	}
	return &GlobImporter{
		innerVerb: innerVerb,
		prefix:    fmt.Sprintf("glob-%s:", innerVerb),
		cache:     map[globCacheKey]*globEntry{},
	}
}
func (g *GlobImporter) cacheKey(resolved, relative string) globCacheKey {
	return globCacheKey{
		verb:     g.innerVerb,
		resolved: resolved,
		relative: relative,
	}
}
func (g *GlobImporter) getEntry(resolved, relative string) *globEntry {
	ret := g.cache[g.cacheKey(resolved, relative)]
	return ret
}
func (g *GlobImporter) setEntry(resolved, relative string, e *globEntry) {
	g.cache[g.cacheKey(resolved, relative)] = e
}