From 25746e9844a6333798e0be6fb0749a18aea73ba6 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 14 Aug 2019 22:18:31 +0800 Subject: [PATCH] adding gres --- os/gres/gres.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/os/gres/gres.go b/os/gres/gres.go index 4c754fc83..b7fffff38 100644 --- a/os/gres/gres.go +++ b/os/gres/gres.go @@ -49,6 +49,14 @@ func Get(path string) *File { return defaultResource.Get(path) } +// GetWithIndex searches file with , if the file is directory +// it then does index files searching under this directory. +// +// GetWithIndex is usually used for http static file service. +func GetWithIndex(path string, indexFiles []string) *File { + return defaultResource.GetWithIndex(path, indexFiles) +} + // Contains checks whether the exists in the default resource object. func Contains(path string) bool { return defaultResource.Contains(path)