Building API server-side architecture for BeginnersInc. � Building API server-side architecture for Beginners GopherCon ���� ����.��.�� - @hgsgtk © ����-���� BASE, Inc. � Talk abstract • A practical approach to build server-side architecture Approach to build architecture � Summary � Talk structure © ����-���� BASE, Inc. � Why I need server-side architecture �.Keep a design easy to change • -> Separate external input/output and business ignored © ����-���� BASE, Inc. �� Go beginners have a lot of questions� How to implement API server by net/http package How to write an unit test How to use interface type - Go basic questions - © ����-����0 码力 | 38 页 | 690.29 KB | 1 年前3
1.3 七牛如何做HTTP服务测试七牛如何做 HTTP服务测试? 许式伟 2015-4-18 HTTP服务测试 • 单元测试 – 某个独立子服务的测试 • 集成测试 – 整个集群对外业务API的测试 • Stage环境 • Product环境 怎么测? • 七牛早期做法 – 实现服务逻辑(Service Implementation) 直接基于协议测试呢? – 比如,基于 http.Client 类直接写测试案例 • 问题 – 代码相对冗长 – 业务逻辑表达不直观 • 写一些辅助函数能够略为改观,不过会有逐步写测试专用SDK的倾向 七牛当前做法 • 引入 httptest DSL 文法 • 更接近基于 http.Client 写测试案例的思路 比如 `qiniu f2weae23e6c9f jg35fae526kbce` 返回一个 auth object,用字符串无法表达 http Request 的表达 req <http-method> header … header 0 码力 | 27 页 | 422.11 KB | 1 年前3
Iteratively Migrating an HTTP Service to Go and gRPC Using grpc-gateway and httputil.ReverseProxyIteratively Migrating an HTTP Service to Go and gRPC Using grpc-gateway and httputil.ReverseProxy Igor Dubinskiy GitHub: idubinskiy Twitter: idubins ● Everything but the browser a. Modify clients existing service Options to migrate a service from HTTP to gRPC Proxy using grpc-gateway and httputil.ReverseProxy https://github.com/idubinskiy/http-to-grpc-gateway Demo Thank you!0 码力 | 6 页 | 740.76 KB | 1 年前3
Casdoor · An Open Source UI-first Identity Access Management (IAM) / Single-Sign-On (SSO) platform supporting OAuth 2.0, OIDC, SAML and CAStransition to Casdoor. 9. Casdoor supports mainstream databases such as MySQL, PostgreSQL, and SQL Server, and it supports the extension of new databases with plugins. Ho How it w w it works orks St Step Now I can use it to access something more valuable from the Resource Server !" Your Application then turns to the Resource Server and says: "Hey buddy, can you check out this access_token ? I received issued to Casdoor?" St Step 6 (Pr ep 6 (Prot otect ected R ed Resour esource) ce) The Resource Server responds to your Application: "Not bad. It seems just like the one I issued to Casdoor, and Casdoor0 码力 | 825 页 | 58.31 MB | 1 年前3
基于 mesos 的容器调度框架mesos 的容器调度框架 http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 1/36 基于 mesos 的容器调度框架 Gopher 杭州 meetup 5 August 2017 黄励博(huangnauh) 又拍云 2017/8/3 基于 mesos 的容器调度框架 http://go-talks.appspot Upone 2017/8/3 基于 mesos 的容器调度框架 http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 3/36 Mesos 介绍 Image credit: mesos.apache.org (http://mesos.apache.org/) 官方称之为分布式系统内核, 它把数据中心的 CPU、内存、磁盘等抽象成一个资源池 CPU、内存、磁盘等抽象成一个资源池 2017/8/3 基于 mesos 的容器调度框架 http://go-talks.appspot.com/github.com/huangnauh/slides/upone.slide#3 4/36 Mesos 调度 各个 Agent 启动后, 向 Master 注册,携带统计资源, 由 Master 决定给每个框架多少资源, 默认 采用分级主导资源公平算法0 码力 | 36 页 | 2.49 MB | 1 年前3
1.6 resource scheduling & container technology for financial service_yujun n 雏形和明天 Gopher China 2015 金融行业IT基础架构的现状、特点、挑战 RISC Server RISC Server RISC Server High-End Storage Busines A Busines B Busines C Gopher 2015 金融行业IT基础架构的现状、特点、挑战 Dev/Test Staging Production RISC Server RISC Server RISC Server High-End Storage Busines A Busines B Busines C Infra 2015 求解之路的探索 n 是否已经存在类似的解? n 传统: HPC中的PBS 和 Condor n 现代: Hadoop YARN,Apache Mesos,Google Kubernetes Gopher China 2015 求解之路的探索 n 他们是否解决了我们的问题? n0 码力 | 21 页 | 27.20 MB | 1 年前3
2.7 Golang与高性能DSP竞价系统第⼀一次签⼊入 专业DSP解决⽅方案 © ⼲⼴广州舜⻜飞信息科技有限公司 All Right ReservedAll Right Reserved • http包的HelloWorld性能测试 为什么选择Golang Via: http://www.cnblogs.com/QLeelulu/archive/2012/08/12/2635261.html 专业DSP解决⽅方案 © ⼲⼴广州舜⻜飞信息科技有限公司 ⼲⼴广州舜⻜飞信息科技有限公司 All Right ReservedAll Right Reserved • 直接⽤用golang的http包 • 只使⽤用gorilla/mux做简单的请求路由 • 封装简单的HTTPBaseHandler HTTP竞价接⼝口 专业DSP解决⽅方案 © ⼲⼴广州舜⻜飞信息科技有限公司 All Right ReservedAll Right Reserved Right ReservedAll Right Reserved Dispatch: 数据、状态同步 Dispatch etcd Bid Server Bid Server . . Bid Server Bid Server 队列 专业DSP解决⽅方案 © ⼲⼴广州舜⻜飞信息科技有限公司 All Right ReservedAll Right Reserved0 码力 | 51 页 | 5.09 MB | 1 年前3
1.2 基于 Golang 构建高可扩展的云原生 PaaS 平台构建⾼可扩展的云原⽣ PaaS 平台 刘浩杨 端点 技术专家 个⼈简介 - 18年加⼊端点,现任微服务和监控团队负责⼈ - 端点开源 PaaS Erda 的核⼼架构师 - 开源爱好者, Apache SkyWalking PMC 成员 ⽬ 录 ⾯向云原⽣的软件交付 01 端点⼀站式 PaaS - Erda 02 Erda 架构的思考 03 模块化开发框架 04 开源新时代的挑战 context: ${git-checkout} stage: - release: params: services: trade-server: ${buildpack:image} erda_yaml: ${git-checkout}/erda.yaml stage: - deploy: params: 扩展规范,任意扩展 Workload 管理 - Create - Update - Delete - Describe - Scale - Restart services: trade-server: resources: cpu: 2 mem: 2048 deployments: replicas: 2 ports: -0 码力 | 40 页 | 8.60 MB | 1 年前3
Go Web编程go,执行生成的文件,就会在底目 录下生成相应的html文件 交流 交流 欢迎大家加入QQ群:259316004 《Go Web编程》专用交流群 大家有问题还可以上德问上一起交流学习:http://www.dewen.org/topic/165 致谢 致谢 首先要感谢Golang-China的QQ群102319854,里面的每一个人都很热心,同时要特别感谢几个人 四月份平民 面向对象 2.6. interface 2.7. 并发 2.8. 小结 3.Web基础 3.1 web工作方式 3.2 Go搭建一个简单的web服务 3.3 Go如何使得web工作 3.4 Go的http包详解 3.5 小结 4.表单 4.1 处理表单的输入 4.2 验证表单的输入 4.3 预防跨站脚本 4.4 防止多次递交表单 4.5 处理文件上传 4.6 小结 5.访问数据库 5.1 例如builtin包,那么执行go doc builtin 如果是http包,那么执行go doc net/http 查看某一个包里面的函数,那么执行godoc fmt Printf 也可以查看相应的代码,执行godoc -src fmt Printf 通过命令在命令行执行 godoc -http=:端口号 比如godoc -http=:8080。然后在浏览器中打开 127.0.0.1:8080,你将会看到一个golang0 码力 | 295 页 | 5.91 MB | 1 年前3
1.8 Go 在持续交付中的实践Vendoring/Versioning http://godoc.org/github.com/tools/godep Self-Sufficient Code-Sufficient Static website Web frontend User DB Queue Analytics DB Development VM QA server Public Cloud Contributor’s /entrypoint.sh mysqld Up 3306/tcp vagrant_wordpress_1 /entrypoint.sh apache2-for ... Up 0.0.0.0:80->80/tcp Reproducible Delivery The Landscape with Containers Demo0 码力 | 33 页 | 7.85 MB | 1 年前3
共 91 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













