Browse Source

Static files from external repo

Vova Tkach 6 years ago
parent
commit
ee973559dc

+ 9 - 0
Gopkg.lock

@@ -25,6 +25,14 @@
   revision = "e000912f70a8354cc4d0bd05617629970e05c9b9"
   version = "v1.0.1"
 
+[[projects]]
+  digest = "1:6f6c69e51e5661d173aef0a46bbe99761ff947cc84d2a33a6be71bb483db73a1"
+  name = "github.com/vladimirok5959/golang-server-static"
+  packages = ["static"]
+  pruneopts = "UT"
+  revision = "00804ab7b07769acb79f9e13b1f91c91ec812393"
+  version = "v1.0.0"
+
 [solve-meta]
   analyzer-name = "dep"
   analyzer-version = 1
@@ -32,6 +40,7 @@
     "github.com/vladimirok5959/golang-server-bootstrap/bootstrap",
     "github.com/vladimirok5959/golang-server-resources/resource",
     "github.com/vladimirok5959/golang-server-sessions/session",
+    "github.com/vladimirok5959/golang-server-static/static",
   ]
   solver-name = "gps-cdcl"
   solver-version = 1

+ 3 - 2
main.go

@@ -9,12 +9,12 @@ import (
 
 	"golang-fave/assets"
 	"golang-fave/consts"
-	"golang-fave/static"
 	"golang-fave/utils"
 
 	"github.com/vladimirok5959/golang-server-bootstrap/bootstrap"
 	"github.com/vladimirok5959/golang-server-resources/resource"
 	"github.com/vladimirok5959/golang-server-sessions/session"
+	"github.com/vladimirok5959/golang-server-static/static"
 )
 
 var ParamHost string
@@ -36,6 +36,7 @@ func main() {
 		return
 	}
 
+	// Init mounted resources
 	res := resource.New()
 	res.Add(consts.AssetsCpScriptsJs, "application/javascript; charset=utf-8", assets.CpScriptsJs)
 	res.Add(consts.AssetsCpStylesCss, "text/css", assets.CpStylesCss)
@@ -45,7 +46,7 @@ func main() {
 	res.Add(consts.AssetsSysLogoSvg, "image/svg+xml", assets.SysLogoSvg)
 	res.Add(consts.AssetsSysStylesCss, "text/css", assets.SysStylesCss)
 
-	// TODO: Move this to `"github.com/vladimirok5959/golang-server-static/static"`
+	// Init static files helper
 	stat := static.New(consts.DirIndexFile)
 
 	// TODO: Logic as object here

+ 21 - 0
vendor/github.com/vladimirok5959/golang-server-static/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Vova Tkach
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 0 - 0
static/static.go → vendor/github.com/vladimirok5959/golang-server-static/static/static.go