add cmd/open_im_msg_gateway

This commit is contained in:
xmcy0011
2021-10-11 21:39:05 +08:00
parent 9367ad901d
commit 5fb4ea2aa3
7 changed files with 1 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
.PHONY: all build run gotool install clean help
BINARY_NAME=open_im_msg_gateway
BIN_DIR=../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE}
run:
@go run ./
gotool:
go fmt ./
go vet ./
install:
make build
mv ${BINARY_NAME} ${BIN_DIR}
clean:
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
+18
View File
@@ -0,0 +1,18 @@
package main
import (
"Open_IM/internal/msg_gateway/gate"
"flag"
"sync"
)
func main() {
rpcPort := flag.Int("rpc_port", 10500, "rpc listening port")
wsPort := flag.Int("ws_port", 10800, "ws listening port")
flag.Parse()
var wg sync.WaitGroup
wg.Add(1)
gate.Init(*rpcPort, *wsPort)
gate.Run()
wg.Wait()
}