added metadata helper tool

This commit is contained in:
ston1th 2022-03-29 21:43:23 +02:00
commit 28232d976b
299 changed files with 161208 additions and 2 deletions

View file

@ -18,6 +18,7 @@ import (
type FS struct {
log logr.Logger
done chan struct{}
cancel func()
NoCache http.Handler
src string
@ -45,6 +46,7 @@ func NewFS(quota int64, max int, src, dst, metadata string, log logr.Logger) (fs
fs = &FS{
log: log,
done: make(chan struct{}),
cancel: cancel,
NoCache: http.FileServer(http.Dir(src)),
src: src,
@ -249,6 +251,7 @@ func (fs *FS) CacheStatus(name string) int {
func (fs *FS) Close() {
fs.cancel()
<-fs.done
}
func dirEmpty(name string) (bool, error) {