mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
HandleDir: add Attachments options to DirOptions
have a bit more work to do on that, if Gzip option is true then it does not work and it's not the 'if gzip' statement inside the handler Former-commit-id: 866578d29b6a63ee60a22b0eb9b37288c717b7e2
This commit is contained in:
@@ -54,8 +54,19 @@ func main() {
|
||||
filesRouter := app.Party("/files")
|
||||
{
|
||||
filesRouter.HandleDir("/", uploadDir, iris.DirOptions{
|
||||
Gzip: true,
|
||||
Gzip: false,
|
||||
ShowList: true,
|
||||
|
||||
// Optionally, force-send files to the client inside of showing to the browser.
|
||||
Attachments: iris.Attachments{
|
||||
Enable: true,
|
||||
// Optionally, control data sent per second:
|
||||
Limit: 50.0 * iris.KB,
|
||||
Burst: 100 * iris.KB,
|
||||
// Change the destination name through:
|
||||
// NameFunc: func(systemName string) string {...}
|
||||
},
|
||||
|
||||
DirList: iris.DirListRich(iris.DirListRichOptions{
|
||||
// Optionally, use a custom template for listing:
|
||||
// Tmpl: dirListRichTemplate,
|
||||
|
||||
Reference in New Issue
Block a user