diff options
author | Mike Crute <mike@crute.us> | 2023-01-30 18:30:58 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2023-01-30 18:30:58 -0800 |
commit | 3c13745d23b7474b87346fb60903d4dec600fd34 (patch) | |
tree | 7c106384eaffd2087121474ea65083573534f433 | |
parent | 6cb3c4271d3126697c8917bce9312603fa6607ca (diff) | |
download | golib-echo/v0.9.4.tar.bz2 golib-echo/v0.9.4.tar.xz golib-echo/v0.9.4.zip |
echo: support non-cached static routesecho/v0.9.4
-rw-r--r-- | echo/echo_default.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/echo/echo_default.go b/echo/echo_default.go index d6efd5e..76f543d 100644 --- a/echo/echo_default.go +++ b/echo/echo_default.go | |||
@@ -119,6 +119,20 @@ func (w *EchoWrapper) CachedStaticRoute(prefix, path string) { | |||
119 | StaticFS(w.GET, w.templateFS, prefix, path, glmw.CacheOneMonthMiddleware) | 119 | StaticFS(w.GET, w.templateFS, prefix, path, glmw.CacheOneMonthMiddleware) |
120 | } | 120 | } |
121 | 121 | ||
122 | func (w *EchoWrapper) NeverCacheStaticRoute(prefix, path string) { | ||
123 | if w.templateFS == nil { | ||
124 | panic("Attempted to set a static route with no templates loaded") | ||
125 | } | ||
126 | StaticFS(w.GET, w.templateFS, prefix, path, glmw.CacheNeverMiddleware) | ||
127 | } | ||
128 | |||
129 | func (w *EchoWrapper) StaticRoute(prefix, path string) { | ||
130 | if w.templateFS == nil { | ||
131 | panic("Attempted to set a static route with no templates loaded") | ||
132 | } | ||
133 | StaticFS(w.GET, w.templateFS, prefix, path) | ||
134 | } | ||
135 | |||
122 | func (w *EchoWrapper) RunForever(enableBackgroundJobs bool) { | 136 | func (w *EchoWrapper) RunForever(enableBackgroundJobs bool) { |
123 | w.runner.RunForever(enableBackgroundJobs) | 137 | w.runner.RunForever(enableBackgroundJobs) |
124 | } | 138 | } |