use disk storage for fetching git repos as an alternative to in-memory store

This commit is contained in:
Serge Zaitsev
2018-09-25 16:03:04 +02:00
parent b786cfca1b
commit 374bc078c5
4 changed files with 29 additions and 11 deletions

View File

@@ -58,7 +58,8 @@ func main() {
verbose := flag.Bool("v", false, "verbose logging")
debug := flag.Bool("debug", false, "enable debug HTTP API (pprof/expvar)")
json := flag.Bool("json", false, "json structured logging")
dir := flag.String("dir", filepath.Join(os.Getenv("HOME"), ".gomodproxy"), "cache directory")
dir := flag.String("dir", filepath.Join(os.Getenv("HOME"), ".gomodproxy/cache"), "modules cache directory")
gitdir := flag.String("gitdir", filepath.Join(os.Getenv("HOME"), ".gomodproxy/git"), "git cache directory")
memLimit := flag.Int64("mem", 256, "in-memory cache size in MB")
flag.Var(&gitPaths, "git", "list of git settings")
@@ -92,6 +93,7 @@ func main() {
}
options = append(options,
api.GitDir(*gitdir),
api.Memory(logger, *memLimit*1024*1024),
api.CacheDir(*dir),
)