cplus

command module
v0.0.0-...-205be16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 14 Imported by: 0

README

cplus

cplus 管理服务(rpc)

1. 初始化项目

会根据cplus.proto文件更新项目cpluspbcplusclient

后面若更新proto文件,在项目根目录执行此命令刷新项目:

goctl rpc protoc cplus.proto --go_out=. --go-grpc_out=. --zrpc_out=. --style goZero

# 格式化proto文件(没用ide工具)
clang-format -i cplus.proto

2. 调试、部署测试

  1. 调试本地rpc服务
# 调试远程rpc服务
grpcui -plaintext 192.168.5.119:8083
# 调试本地rpc服务
grpcui -plaintext 127.0.0.1:8083
# 调试生产
grpcui -plaintext 10.2.110.138:8083
  1. 二进制部署测试
go build -o cplus
sudo nohup ./cplus &
# asynqmon命令安装
go get -u github.com/hibiken/asynq/tools/asynqmon
# !安装无效!,直接下载二进制文件,放到go bin文件夹中(全局环境变量):
https://github.com/hibiken/asynqmon/releases
# 使用
asynqmon --port=3000 --redis-addr=localhost:6379
# 指定数据库号
asynqmon --port=3000 --redis-addr=10.2.121.62:6379 --redis-db=7

http://127.0.0.1:3000/
  1. docker k8s部署
# 生成dockerfile
goctl docker -go cplus.go
# 创建cm文件
k create configmap cplus-cm --from-file=etc/cplus.yaml
# 应用deploy
k apply -f cplus.yaml
# 构建镜像
docker build -t open-registry.going-link.com/isrm-public/cplus:v1 -f ./Dockerfile .
# 仓库认证
export DOCKER_USERNAME=admin
export DOCKER_PASSWORD="c7n#2019"
export DOCKER_REGISTRY=open-registry.going-link.com
sudo docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTRY}
# 推镜像
sudo docker push open-registry.going-link.com/isrm-public/cplus:v1
# 重启
k rollout restart deploy cplus

3. 项目依赖

ExtCompPreMap 内外部公司映射,规则:

只有甄云的key带@,代表内部
甄云科技@
其他外部公司都是公司名称:账号英文前缀,其中汉得信息账号不会与甄云重复,因此账号也无需前缀。
汉得信息 ""
盛迭信息 "SD"

weworkMsgTpls 企业微信消息模版

本服务只暂时用到的模版为:

wework_renewal_notify 企业微信账号到期提醒

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
common
internal
svc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL