Skip to content

Commit 04552fc

Browse files
committed
Update for absfs 1.0 compatibility
1 parent d02d00d commit 04552fc

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

go.mod

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
module github.com/absfs/httpfs
22

3-
go 1.25.4
3+
go 1.23
44

55
require (
6-
github.com/absfs/absfs v0.0.0-20251109181304-77e2f9ac4448
7-
github.com/absfs/fstesting v0.0.0-20251207001735-c9d62652ff82
8-
github.com/absfs/memfs v0.0.0-20251207002014-84a861d26e86
6+
github.com/absfs/absfs v0.0.0-20251208232938-aa0ca30de832
7+
github.com/absfs/fstesting v0.0.0-20251207022242-d748a85c4a1e
8+
github.com/absfs/memfs v0.0.0-20251208230836-c6633f45580a
99
)
1010

1111
require github.com/absfs/inode v0.0.2-0.20251124215006-bac3fa8943ab // indirect
12+
13+
replace (
14+
github.com/absfs/absfs => ../absfs
15+
github.com/absfs/fstesting => ../fstesting
16+
github.com/absfs/fstools => ../fstools
17+
github.com/absfs/inode => ../inode
18+
github.com/absfs/memfs => ../memfs
19+
)

go.sum

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
github.com/absfs/absfs v0.0.0-20251109181304-77e2f9ac4448 h1:uN3Q47kmtV6TIGHZbrCbCf68jWmYDWyTcqq5JuoyON4=
2-
github.com/absfs/absfs v0.0.0-20251109181304-77e2f9ac4448/go.mod h1:IvFD36FQcMxLLZNhs2Lms+Uosc0G3AJ2JHOJIz8E5d8=
3-
github.com/absfs/fstesting v0.0.0-20251207001735-c9d62652ff82 h1:mcVMad1EpGeEUdOWws9Ui/2iV1z9FQhA6K2OuSPEWMI=
4-
github.com/absfs/fstesting v0.0.0-20251207001735-c9d62652ff82/go.mod h1:k+GNl+VG/teXQBkCH5vt+gzPtkDCQTjX+hTgpDnnqEs=
5-
github.com/absfs/inode v0.0.2-0.20251124215006-bac3fa8943ab h1:6QoppJnYs2lh5FRADAo2GeR2SjyaVzCf6Q+BjqiZFpU=
6-
github.com/absfs/inode v0.0.2-0.20251124215006-bac3fa8943ab/go.mod h1:98Uz4QOknMBXXWwXUIs2TzSwuz+9mbSAKASbwF1eld8=
7-
github.com/absfs/lockfs v0.0.0-20251124210544-241704814c03 h1:CnVf8nV/DHhbspnqdiF/KYcenfIDT4zcNhJY7w3PdUE=
8-
github.com/absfs/lockfs v0.0.0-20251124210544-241704814c03/go.mod h1:HVN3eRlj4K900z7171bfd7cUM2iyUM8q0YetQDgfbOY=
9-
github.com/absfs/memfs v0.0.0-20251207002014-84a861d26e86 h1:Gjw5EdMQJ2oW39ZHC1vKiyGGWHrDmTCaSSTi5d8AXdw=
10-
github.com/absfs/memfs v0.0.0-20251207002014-84a861d26e86/go.mod h1:4bZb+0v9wwFh3fa3ryyycA6bt7Ualw6inIiIfFa7Bi4=
111
github.com/absfs/osfs v0.1.0-fastwalk h1:dEHAusiK/K8ROQgohL25q+cyqbiMXzSt1pgR3nbhNEg=
122
github.com/absfs/osfs v0.1.0-fastwalk/go.mod h1:IIzwVILCbb3j0VHjcAQ7Xwpdz1h57eUzZil7DCIel/c=

httpfs.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package httpfs
66

77
import (
8+
"io/fs"
89
"net/http"
910
"os"
1011
"path"
@@ -151,3 +152,20 @@ func (filer *Httpfs) Chtimes(name string, atime time.Time, mtime time.Time) erro
151152
func (filer *Httpfs) Chown(name string, uid, gid int) error {
152153
return filer.fs.Chown(name, uid, gid)
153154
}
155+
156+
// ReadDir reads the named directory and returns a list of directory entries
157+
// sorted by filename.
158+
func (filer *Httpfs) ReadDir(name string) ([]fs.DirEntry, error) {
159+
return filer.fs.ReadDir(name)
160+
}
161+
162+
// ReadFile reads the named file and returns its contents.
163+
// A successful call returns err == nil, not err == EOF.
164+
func (filer *Httpfs) ReadFile(name string) ([]byte, error) {
165+
return filer.fs.ReadFile(name)
166+
}
167+
168+
// Sub returns an fs.FS corresponding to the subtree rooted at dir.
169+
func (filer *Httpfs) Sub(dir string) (fs.FS, error) {
170+
return absfs.FilerToFS(filer.fs, dir)
171+
}

0 commit comments

Comments
 (0)