added disk quota
This commit is contained in:
parent
4499e88245
commit
9cc2b04342
26 changed files with 1376 additions and 61 deletions
|
|
@ -10,6 +10,8 @@ import (
|
|||
"strings"
|
||||
|
||||
"cachefs/pkg/fs"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
type statusInterceptor struct {
|
||||
|
|
@ -51,9 +53,7 @@ type file struct {
|
|||
|
||||
type files []file
|
||||
|
||||
func (f files) Len() int { return len(f) }
|
||||
func (f files) Less(i, j int) bool { return f[i].Name < f[j].Name }
|
||||
func (f files) Swap(i, j int) { f[i], f[j] = f[j], f[i] }
|
||||
func (files) Less(i, j file) bool { return i.Name < j.Name }
|
||||
|
||||
type responseInterceptor struct {
|
||||
buf bytes.Buffer
|
||||
|
|
@ -98,7 +98,7 @@ func (r *responseInterceptor) GetPaths(path string, fs *fs.FS) (dir dirContents,
|
|||
}
|
||||
}
|
||||
sort.Strings(dir.Dirs)
|
||||
sort.Sort(dir.Files)
|
||||
slices.SortFunc(dir.Files, dir.Files.Less)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue