diff --git a/go.mod b/go.mod index 456613d..18be4e8 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/gin-gonic/gin v1.7.2 github.com/go-redis/redis/v7 v7.4.0 github.com/golang/protobuf v1.5.1 + github.com/google/flatbuffers v2.0.0+incompatible // indirect github.com/mattn/go-isatty v0.0.12 github.com/mitchellh/mapstructure v1.4.1 github.com/msalihkarakasli/go-hms-push v0.0.0-20200616114002-91cd23dfeed4 diff --git a/go.sum b/go.sum index 1719cfe..5bd0cce 100644 --- a/go.sum +++ b/go.sum @@ -184,8 +184,9 @@ github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v2.0.0+incompatible h1:dicJ2oXwypfwUGnB2/TYWYEKiuk9eYQlQO/AnOHl5mI= +github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= diff --git a/netlify.toml b/netlify.toml index d5e4539..7eaa48c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,6 +3,7 @@ functions = "release/linux/lambda" [build.environment] + GO_VERSION = "1.16" GO_IMPORT_PATH = "github.com/appleboy/gorush" GO111MODULE = "on" diff --git a/router/server_lambda.go b/router/server_lambda.go index dfd2f46..40f1b05 100644 --- a/router/server_lambda.go +++ b/router/server_lambda.go @@ -4,6 +4,10 @@ package router import ( "context" + "net/http" + + "github.com/appleboy/gorush/config" + "github.com/appleboy/gorush/logx" "github.com/apex/gateway" ) @@ -11,11 +15,11 @@ import ( // RunHTTPServer provide run http or https protocol. func RunHTTPServer(ctx context.Context, cfg config.ConfYaml, s ...*http.Server) (err error) { if !cfg.Core.Enabled { - LogAccess.Debug("httpd server is disabled.") + logx.LogAccess.Debug("httpd server is disabled.") return nil } - LogAccess.Info("HTTPD server is running on " + cfg.Core.Port + " port.") + logx.LogAccess.Info("HTTPD server is running on " + cfg.Core.Port + " port.") - return gateway.ListenAndServe(cfg.Core.Address+":"+cfg.Core.Port, routerEngine()) + return gateway.ListenAndServe(cfg.Core.Address+":"+cfg.Core.Port, routerEngine(cfg)) }