Git Product home page Git Product logo

go-training's Introduction

题1 我选WebSocket 端口8080

实现方法

  • 基于gnet实现,WS的解析来自于gobwas
  • Gin也可以实现,原理也差不多一样,

关于3点要求的说明

1.简单API设计说明文档, 罗列所实现的API路径及调用说明。 以README.md文档形式即可

没太理解什么意思,这个WebSocket没有任何的业务方法,无论上行什么都会返回hello,没有业务的API。

运行说明

  • 运行server_text.go 启动服务端
  • 客户端我安装了mac版本的WebSocket Client

题2

  • 我本机是的Golang 是1.18版本,为了避免和您的机器上版本不一致,所以build的过程也放到镜像中构建,构建完成后直接启动。当然也可以本地构建。
  • docker build 命令
docker build --build-arg SV=1023 -t jinsong/go-training:1.0.7 .
//SERVER_VERSION 通过SV指定
  • docker run 命令
docker run -p 8080:8080 jinsong/go-training:1.0.7     
docker run -p 8080:8080 -d jinsong/go-training:1.0.7

题3

  • 详见go-training.yaml
  • 这里是NodePort方式
  • 手动扩容
  • kubectl scale deployment go-training --replicas=10

go-training's People

Contributors

magicnana999 avatar

Watchers

James Cloos avatar  avatar

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.