From bc00d840e845d42145954839b88f1e836cd51bfd Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 22 May 2019 12:32:36 -0600 Subject: Export types and fields necessary to build configs (for config adapters) Also flag most fields with 'omitempty' for JSON marshaling --- modules/caddyhttp/fileserver/browse.go | 2 +- modules/caddyhttp/fileserver/staticfiles.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/caddyhttp/fileserver') 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 } -- cgit v1.2.3