Bump to 0.12.0 (#345)

This commit is contained in:
Nova Kwok 2024-06-29 16:46:15 +08:00 committed by GitHub
parent 89ea0affa3
commit d29959cbd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 8 deletions

View File

@ -51,7 +51,7 @@ var (
ProxyMode bool
Prefetch bool
Config = NewWebPConfig()
Version = "0.11.4"
Version = "0.12.0"
WriteLock = cache.New(5*time.Minute, 10*time.Minute)
ConvertLock = cache.New(5*time.Minute, 10*time.Minute)
LocalHostAlias = "local"

View File

@ -22,6 +22,7 @@ func TestLoadConfig(t *testing.T) {
assert.Equal(t, Config.ImageMap, map[string]string{})
assert.Equal(t, Config.ExhaustPath, "./exhaust")
assert.Equal(t, Config.CacheTTL, 259200)
assert.Equal(t, Config.MaxCacheSize, 0)
}
func TestSwitchProxyMode(t *testing.T) {
@ -35,14 +36,14 @@ func TestSwitchProxyMode(t *testing.T) {
func TestParseImgMap(t *testing.T) {
empty := map[string]string{}
good := map[string]string{
"/1": "../pics/dir1",
"http://example.com": "../pics",
"/1": "../pics/dir1",
"http://example.com": "../pics",
"https://example.com": "../pics",
}
bad := map[string]string{
"1": "../pics/dir1",
"1": "../pics/dir1",
"httpx://example.com": "../pics",
"ftp://example.com": "../pics",
"ftp://example.com": "../pics",
}
assert.Equal(t, empty, parseImgMap(empty))

2
go.mod
View File

@ -19,7 +19,7 @@ require (
require (
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect

2
go.sum
View File

@ -13,6 +13,8 @@ github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84Egg
github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/h2non/filetype v1.1.4-0.20230123234534-cfcd7d097bc4 h1:k7FGP5I7raiaC3aAzCLddcoxzboIrOm6/FVRXjp/5JM=
github.com/h2non/filetype v1.1.4-0.20230123234534-cfcd7d097bc4/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c h1:fEE5/5VNnYUoBOj2I9TP8Jc+a7lge3QWn9DKE7NCwfc=