Skip to content

Commit 1455cc0

Browse files
authored
Merge pull request #8 from jilio/feat/http-fs
feat: Implement `ReadDir` to support `http.FS`
2 parents 2d70a59 + fe7a66f commit 1455cc0

File tree

5 files changed

+342
-45
lines changed

5 files changed

+342
-45
lines changed

examples/ginexample/go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22.0
44

55
require (
66
github.com/gin-gonic/gin v1.9.1
7-
github.com/jilio/sqlitefs v0.2.0
7+
github.com/jilio/sqlitefs v0.0.0
88
modernc.org/sqlite v1.29.2
99
)
1010

@@ -45,3 +45,5 @@ require (
4545
modernc.org/strutil v1.2.0 // indirect
4646
modernc.org/token v1.1.0 // indirect
4747
)
48+
49+
replace github.com/jilio/sqlitefs => ../../

examples/ginexample/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"database/sql"
5+
"net/http"
56

67
"github.com/gin-gonic/gin"
78
"github.com/jilio/sqlitefs"
@@ -22,7 +23,7 @@ func main() {
2223

2324
r := gin.Default()
2425
r.GET("/logo.png", func(c *gin.Context) {
25-
c.FileFromFS("/images/sqlitefs.png", sfs)
26+
c.FileFromFS("/images/sqlitefs.png", http.FS(sfs))
2627
})
2728
r.Run() // listen and serve on 0.0.0.0:8080
2829
}

examples/ginexample/sample.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)