Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom directory-listing mode for FileServer #19

Open
umputun opened this issue Aug 23, 2021 · 0 comments
Open

custom directory-listing mode for FileServer #19

umputun opened this issue Aug 23, 2021 · 0 comments

Comments

@umputun
Copy link
Member

umputun commented Aug 23, 2021

With #18 in place, one of the new options allows directory listing. Unfortunately, the one from stdlib is as ugly as hell and not customizable at all. It would be very nice to add the ability to make this list somewhat custom. Ideally, it should support some template with {{.Name}} {{.Size}} {{.DateTime}} and so on.

I don't see a direct way to achieve it and can think of a couple of hacks:

  1. Define a custom response writer to intercept and replace the standard list of files. Very unclear how to even detect the list output, how to eliminate dbl/read, and so on
  2. Implement our own http.File / http.Dir on top of stdlib. Also a lot of questions here and potential issues.
  3. something else?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant