From 304855c5a4c16ddeff552ee838ef52ab5df73461 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 7 Jun 2017 02:59:14 -0500 Subject: [PATCH] feat: support storage engine flag. (#235) Signed-off-by: Bo-Yi Wu --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index d1893cf..3897aa9 100644 --- a/main.go +++ b/main.go @@ -40,6 +40,7 @@ Server Options: -c, --config Configuration file path -m, --message Notification message -t, --token Notification token + -e, --engine Storage engine (memory, redis ...) --title Notification title --proxy <proxy> Proxy URL (only for GCM) --pid <pid path> Process identifier path @@ -116,6 +117,8 @@ func main() { flag.StringVar(&opts.Core.Port, "port", "", "port number for gorush") flag.StringVar(&token, "t", "", "token string") flag.StringVar(&token, "token", "", "token string") + flag.StringVar(&opts.Stat.Engine, "e", "", "store engine") + flag.StringVar(&opts.Stat.Engine, "engine", "", "store engine") flag.StringVar(&message, "m", "", "notification message") flag.StringVar(&message, "message", "", "notification message") flag.StringVar(&title, "title", "", "notification title") @@ -168,6 +171,10 @@ func main() { gorush.PushConf.Android.APIKey = opts.Android.APIKey } + if opts.Stat.Engine != "" { + gorush.PushConf.Stat.Engine = opts.Stat.Engine + } + // overwrite server port if opts.Core.Port != "" { gorush.PushConf.Core.Port = opts.Core.Port