Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2020-11-12 09:54:46 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-11-30 02:15:09 +0300
commitb0e17d6a69a6e81cd1ca693cba47840de1f230da (patch)
tree5a3e902a9fa427f53fd09feec4f107dbe1ac6242 /internal/serving/disk/zip
parent84abda0e2cc2d47078d20abc1dad338402060b90 (diff)
Add zip config flags
Adds a config package with specific zip configuration structure that can be shared between packages.
Diffstat (limited to 'internal/serving/disk/zip')
-rw-r--r--internal/serving/disk/zip/serving.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/serving/disk/zip/serving.go b/internal/serving/disk/zip/serving.go
index 95894fc9..9b3a7aa7 100644
--- a/internal/serving/disk/zip/serving.go
+++ b/internal/serving/disk/zip/serving.go
@@ -1,16 +1,21 @@
package zip
import (
+ "gitlab.com/gitlab-org/gitlab-pages/internal/config"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs/zip"
)
-var instance = disk.New(vfs.Instrumented(zip.New()))
+var instance serving.Serving
// Instance returns a serving instance that is capable of reading files
// from a zip archives opened from a URL, most likely stored in object storage
func Instance() serving.Serving {
+ if instance == nil {
+ instance = disk.New(vfs.Instrumented(zip.New(config.ZipVFSConfig)))
+ }
+
return instance
}