1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-24 05:17:03 +00:00

directly support embed.FS and fs.FS on view engines

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-09-21 23:26:12 +03:00
parent 5bc0796548
commit 95a8110f1e
12 changed files with 162 additions and 17 deletions

View File

@@ -805,6 +805,13 @@ func (cp *ContextPatches) SetCookieKVExpiration(patch time.Duration) {
context.SetCookieKVExpiration = patch
}
// ResolveFS modifies the default way to resolve a filesystem by any type of value.
// It affects the view engine filesystem resolver
// and the Application's API Builder's `HandleDir` method.
func (cp *ContextPatches) ResolveFS(patchFunc func(fsOrDir interface{}) http.FileSystem) {
context.ResolveFS = patchFunc
}
// ContextWriterPatches features the context's writers patches.
type ContextWriterPatches struct{}