summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-05-22 12:32:36 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-05-22 12:32:36 -0600
commitbc00d840e845d42145954839b88f1e836cd51bfd (patch)
tree0cd9f1103f3056fbadede6fd7de12ec605f50c02 /modules/caddyhttp/fileserver
parentbe9b6e7b57d5bbf13d26b1620d34efc4e12284f7 (diff)
Export types and fields necessary to build configs (for config adapters)
Also flag most fields with 'omitempty' for JSON marshaling
Diffstat (limited to 'modules/caddyhttp/fileserver')
-rw-r--r--modules/caddyhttp/fileserver/browse.go2
-rw-r--r--modules/caddyhttp/fileserver/staticfiles.go16
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/caddyhttp/fileserver/browse.go b/modules/caddyhttp/fileserver/browse.go
index 9869801..bf063e5 100644
--- a/modules/caddyhttp/fileserver/browse.go
+++ b/modules/caddyhttp/fileserver/browse.go
@@ -15,7 +15,7 @@ import (
// Browse configures directory browsing.
type Browse struct {
- TemplateFile string `json:"template_file"`
+ TemplateFile string `json:"template_file,omitempty"`
template *template.Template
}
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go
index c6a01ac..08f92bf 100644
--- a/modules/caddyhttp/fileserver/staticfiles.go
+++ b/modules/caddyhttp/fileserver/staticfiles.go
@@ -27,14 +27,14 @@ func init() {
// FileServer implements a static file server responder for Caddy.
type FileServer struct {
- Root string `json:"root"` // default is current directory
- Hide []string `json:"hide"`
- IndexNames []string `json:"index_names"`
- Files []string `json:"files"` // all relative to the root; default is request URI path
- SelectionPolicy string `json:"selection_policy"`
- Rehandle bool `json:"rehandle"` // issue a rehandle (internal redirect) if request is rewritten
- Fallback caddyhttp.RouteList `json:"fallback"`
- Browse *Browse `json:"browse"`
+ Root string `json:"root,omitempty"` // default is current directory
+ Hide []string `json:"hide,omitempty"`
+ IndexNames []string `json:"index_names,omitempty"`
+ Files []string `json:"files,omitempty"` // all relative to the root; default is request URI path
+ SelectionPolicy string `json:"selection_policy,omitempty"`
+ Rehandle bool `json:"rehandle,omitempty"` // issue a rehandle (internal redirect) if request is rewritten
+ Fallback caddyhttp.RouteList `json:"fallback,omitempty"`
+ Browse *Browse `json:"browse,omitempty"`
// TODO: Etag
// TODO: Content negotiation
}