File tree Expand file tree Collapse file tree 23 files changed +45
-41
lines changed Expand file tree Collapse file tree 23 files changed +45
-41
lines changed Original file line number Diff line number Diff line change @@ -952,7 +952,7 @@ experimental:
952
952
plugins:
953
953
souin:
954
954
moduleName: github.com/darkweak/souin
955
- version: v1.7.0
955
+ version: v1.7.1
956
956
```
957
957
After that you can declare either the whole configuration at once in the middleware block or by service. See the examples below.
958
958
``` yaml
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ toolchain go1.22.4
6
6
7
7
require (
8
8
github.com/beego/beego/v2 v2.1.1
9
- github.com/darkweak/souin v1.7.0
9
+ github.com/darkweak/souin v1.7.1
10
10
github.com/darkweak/souin/plugins/souin v0.0.0-00010101000000-000000000000
11
11
github.com/darkweak/souin/plugins/souin/storages v0.0.0-00010101000000-000000000000
12
12
)
@@ -184,7 +184,7 @@ require (
184
184
)
185
185
186
186
replace (
187
- github.com/darkweak/souin v1.7.0 => ../..
187
+ github.com/darkweak/souin v1.7.1 => ../..
188
188
github.com/darkweak/souin/plugins/souin => ../souin
189
189
github.com/darkweak/souin/plugins/souin/storages => ../souin/storages
190
190
)
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ func (s *SouinCaddyMiddleware) parseStorages(ctx caddy.Context) {
121
121
address := redis .URL
122
122
username := ""
123
123
dbname := "0"
124
- cname := ""
124
+ cname := "souin-redis "
125
125
if c := redis .Configuration ; c != nil {
126
126
p , ok := c .(map [string ]interface {})
127
127
if ok {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ go 1.22.1
4
4
5
5
require (
6
6
github.com/caddyserver/caddy/v2 v2.8.4
7
- github.com/darkweak/souin v1.7.0
7
+ github.com/darkweak/souin v1.7.1
8
8
github.com/darkweak/storages/core v0.0.8
9
9
)
10
10
@@ -153,4 +153,4 @@ require (
153
153
howett.net/plist v1.0.0 // indirect
154
154
)
155
155
156
- replace github.com/darkweak/souin v1.7.0 => ../..
156
+ replace github.com/darkweak/souin v1.7.1 => ../..
Original file line number Diff line number Diff line change @@ -116,6 +116,10 @@ func (s *SouinCaddyMiddleware) configurationPropertyMapper() error {
116
116
return nil
117
117
}
118
118
119
+ func isProviderEmpty (c configurationtypes.CacheProvider ) bool {
120
+ return c .Configuration == nil && c .Path == "" && c .URL == ""
121
+ }
122
+
119
123
// FromApp to initialize configuration from App structure.
120
124
func (s * SouinCaddyMiddleware ) FromApp (app * SouinApp ) error {
121
125
if s .Configuration .GetDefaultCache () == nil {
@@ -199,7 +203,7 @@ func (s *SouinCaddyMiddleware) FromApp(app *SouinApp) error {
199
203
if dc .CacheName == "" {
200
204
s .Configuration .DefaultCache .CacheName = appDc .CacheName
201
205
}
202
- if ! s . Configuration . DefaultCache . Distributed && ! dc .Olric . Found && ! dc .Redis . Found && ! dc .Etcd . Found && ! dc .Badger . Found && ! dc .Nuts . Found && ! dc .Otter . Found {
206
+ if isProviderEmpty ( dc . Badger ) && isProviderEmpty ( dc .Etcd ) && isProviderEmpty ( dc .Nats ) && isProviderEmpty ( dc .Nuts ) && isProviderEmpty ( dc .Olric ) && isProviderEmpty ( dc .Otter ) && isProviderEmpty ( dc .Redis ) {
203
207
s .Configuration .DefaultCache .Distributed = appDc .Distributed
204
208
s .Configuration .DefaultCache .Olric = appDc .Olric
205
209
s .Configuration .DefaultCache .Redis = appDc .Redis
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/chi
3
3
go 1.22.1
4
4
5
5
require (
6
- github.com/darkweak/souin v1.7.0
6
+ github.com/darkweak/souin v1.7.1
7
7
github.com/darkweak/souin/plugins/souin/storages v0.0.0-00010101000000-000000000000
8
8
github.com/go-chi/chi/v5 v5.0.12
9
9
)
@@ -179,6 +179,6 @@ require (
179
179
)
180
180
181
181
replace (
182
- github.com/darkweak/souin v1.7.0 => ../..
182
+ github.com/darkweak/souin v1.7.1 => ../..
183
183
github.com/darkweak/souin/plugins/souin/storages => ../souin/storages
184
184
)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/dotweb
3
3
go 1.22.1
4
4
5
5
require (
6
- github.com/darkweak/souin v1.7.0
6
+ github.com/darkweak/souin v1.7.1
7
7
github.com/darkweak/souin/plugins/souin/storages v0.0.0-00010101000000-000000000000
8
8
github.com/devfeel/dotweb v1.7.21
9
9
)
@@ -180,6 +180,6 @@ require (
180
180
)
181
181
182
182
replace (
183
- github.com/darkweak/souin v1.7.0 => ../..
183
+ github.com/darkweak/souin v1.7.1 => ../..
184
184
github.com/darkweak/souin/plugins/souin/storages => ../souin/storages
185
185
)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/echo
3
3
go 1.22.1
4
4
5
5
require (
6
- github.com/darkweak/souin v1.7.0
6
+ github.com/darkweak/souin v1.7.1
7
7
github.com/darkweak/souin/plugins/souin/storages v0.0.0-00010101000000-000000000000
8
8
github.com/darkweak/storages/core v0.0.8
9
9
github.com/labstack/echo/v4 v4.11.1
@@ -182,6 +182,6 @@ require (
182
182
)
183
183
184
184
replace (
185
- github.com/darkweak/souin v1.7.0 => ../..
185
+ github.com/darkweak/souin v1.7.1 => ../..
186
186
github.com/darkweak/souin/plugins/souin/storages => ../souin/storages
187
187
)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/fiber
3
3
go 1.22.1
4
4
5
5
require (
6
- github.com/darkweak/souin v1.7.0
6
+ github.com/darkweak/souin v1.7.1
7
7
github.com/darkweak/souin/plugins/souin/storages v0.0.0-00010101000000-000000000000
8
8
github.com/gofiber/fiber/v2 v2.52.1
9
9
github.com/valyala/fasthttp v1.51.0
@@ -185,6 +185,6 @@ require (
185
185
)
186
186
187
187
replace (
188
- github.com/darkweak/souin v1.7.0 => ../..
188
+ github.com/darkweak/souin v1.7.1 => ../..
189
189
github.com/darkweak/souin/plugins/souin/storages => ../souin/storages
190
190
)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/darkweak/souin/plugins/gin
3
3
go 1.22.1
4
4
5
5
require (
6
- github.com/darkweak/souin v1.7.0
6
+ github.com/darkweak/souin v1.7.1
7
7
github.com/darkweak/souin/plugins/souin/storages v0.0.0-00010101000000-000000000000
8
8
github.com/gin-gonic/gin v1.9.1
9
9
)
@@ -196,6 +196,6 @@ require (
196
196
)
197
197
198
198
replace (
199
- github.com/darkweak/souin v1.7.0 => ../..
199
+ github.com/darkweak/souin v1.7.1 => ../..
200
200
github.com/darkweak/souin/plugins/souin/storages => ../souin/storages
201
201
)
You can’t perform that action at this time.
0 commit comments