Coder Social home page Coder Social logo

trainking / goboot Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 665 KB

goboot is a scaffolding that can be used to open http, gRPC and custom game servers.一个可以用来开http,gRPC和自定义游戏服务器的脚手架。

License: MIT License

Go 99.76% Shell 0.24%
game-server golang

goboot's Introduction

GOBOOT

概述

GOBOOT 是一个可以用来开http,gRPC和自定义游戏服务器的Golang脚手架。

特性

  • 高性能分布式服务器开发
  • 支持gRPC开发微服务
  • 支持http的API开发
  • 支持游戏服务器网关开发,支持tcpkcpwebsocket协议
  • 提供了bootctl作为,项目管理和代码生成工具

快速开始

使用bootctl

goboot推荐使用bootctl命令行工具,来生成代码结构和代码,方便在多人开发时,控制编码规范。具体参考

一个规范的目录结构如下:

├─bin                             # build之后的发布包
├─cmd                             # 自定义的命令行工具
├─configs                         # 所有的配置文件
├─docs                            # 项目相关文档
|  ├─devel                        # 开发相关文档,如接口描述
│  └─guide                        # 教程相关文档
├─example                         # 一些小示例,或测试demo
├─internal                        # 业务代码
│  ├─api                          # 应用程序接口,http和game
│  │  ├─gameserver
│  │  │  └─gateway
│  │  └─helloworld
│  │      └─user
│  ├─pb                           # protbuf生成库
│  │  └─proto                     # .proto文件
│  └─service                      # 服务
│      └─user
│          ├─client
│          └─server
├─logs                            # 日志
│  └─Gateway
└─pkg                             # 公共包

详情请查阅参考指南

关联项目

打赏作者

打赏

goboot's People

Contributors

trainking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

goboot's Issues

httpapi的App实例,需要增加一个保存各个Module可以共享的容器结构

问题描述:

  1. 同一个App实例的各个Module之间,存在共享数据的情况,例如缓存
  2. 同一个App实例中各个Module之间,存在使用同样的组件,如验证组件,这种组件,只需要实例一个就可以了

解决方案:

在App中,增加一个容器结构保存对应的实例的内容,通过共享Context,实现相关的共享

增加groupcache作为gameapi的缓存

Groupcache是一个基于Go语言的分布式缓存库,由Google开发和维护。引入它有以下几个好处:

  1. 它是分布式的,可以解决多个实例节点之间,缓存的同步问题;
  2. 它是直接内存数据,结构上贴近golang,比redis有更好的开发兼容性;
  3. 可以设置缓存过期时间和淘汰机制;

依赖版本号的服务器更新

gameapi需实现,根据版本变更来获取系统更新的系统:

  1. 每个gameapi需要一个版本号
  2. 修改获取器的版本号,决定选用哪个版本号
  3. 非此版本系统,停服

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.