Giter VIP home page Giter VIP logo

microservice's Introduction

Microservice

概述

这是一个基于golang开发的游戏微服务架构,每个服务都实现了水平扩展。 RUNOOB 图标

依赖

本架构使用了一些第三方开源库来实现相关功能

  • HTTP接口(github.com/gin-gonic/gin)
  • 数据库连接 (github.com/go-xorm/xorm)
  • Redis连接 (github.com/gomodule/redigo/redis)
  • 协议(github.com/golang/protobuf)
  • 日志(github.com/sirupsen/logrus)
  • 服务注册(github.com/hashicorp/consul)
  • 配置读取(github.com/Unknwon/goconfig)

安装

安装 Mysql

安装 Redis

安装 Consul

安装 Microservice

git clone https://github.com/stringMao/Microservice.git

cd LoginSvr

go build

cd ../GateSvr

go build

cd ../HallSvr

go build

配置

每个服务器启动前,同级目录下都需要配置app.ini。例如以下是GateSvr的配置模板

[log]
level = debug
[webmanager]
ip=127.0.0.1
port =8092
# 服务发现consul的地址
consuladdr = 127.0.0.1:8500


[server]
#该类型服务下的唯一ID
sid = 1


[business]
#客户端连接监听端口
clientPort=8090
#服务器连接的监听端口
serverPort=8091


[redis]
host = 127.0.0.1
port = 6379
username = root
password = ***
database=1
maxopenconns = 20
maxidleconns=5

[mysql]
host = 127.0.0.1
port = 3306
username = ###
password = ***
dbname = player
maxopenconns = 100
maxidleconns=10

协议结构

msg struct

RUNOOB 图标

microservice's People

Contributors

stringmao avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

chenhongjack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.