func ListPackageHash(vlog, events metrics.Metrics, targetDir string, ctx build.Context) (PackageHashList, error) {
	var list PackageHashList
	list.Dir = targetDir
	list.Subs = make(map[string]HashList)
	var err error
	list.Main, err = HashPackages(vlog, events, targetDir, ctx)
	if err != nil {
		events.Emit(metrics.Errorf("Failed to generate function list : %+q", err))
		return list, err
	}
	var hash []byte
	hash = append(hash, []byte(list.Main.Hash)...)
	if err = vfiles.WalkDirSurface(targetDir, func(rel string, abs string, info os.FileInfo) error {
		if !info.IsDir() {
			return nil
		}
		res, err2 := HashPackages(vlog, events, abs, ctx)
		if err2 != nil {
			if err2 == ErrSkipDir {
				return nil
			}
			return err2
		}
		res.RelPath = rel
		list.Subs[res.Path] = res
		hash = append(hash, []byte(res.Hash)...)
		return nil
	}); err != nil {
		events.Emit(metrics.Error(err), metrics.With("dir", targetDir))
		return list, err
	}
	list.SuperHash = string(hash)
	return list, nil
}
ListPackageHash returns all functions retrieved from the directory filtered by the build.Context.
package samurai
import (
	"os"
	"github.com/influx6/faux/metrics"
	"github.com/influx6/faux/vfiles"
	"github.com/influx6/gobuild/build"
	"github.com/influx6/gobuild/srcpath"
	"github.com/influx6/moz/ast"
)
type PackageHashList struct {
	Dir       string              `json:"dir"`
	SuperHash string              `json:"super_hash"`
	Main      HashList            `json:"main"`
	Subs      map[string]HashList `json:"subs"`
}