-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
1,377 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
.* | ||
!.gitignore | ||
_book | ||
node_modules | ||
assets/images/uml/*/*.uml | ||
assets/images/uml/*/*.uml.sum | ||
|
||
public/ | ||
themes/ | ||
update_theme.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
# gRPC学习笔记 | ||
|
||
gRPC 是 google 最新发布(开始于2015年2月,1.0正式版本发布于2016年8月)的开源 RPC 框架, 声称是"一个高性能,开源,将移动和HTTP/2放在首位的通用的RPC框架.". 技术栈非常的新, 基于HTTP/2, netty4.1, proto3, 拥有非常丰富而实用的特性, 堪称新一代RPC框架的典范. | ||
### 内容介绍 | ||
|
||
这是个人学习gRPC的笔记,请点击下面的链接阅读或者下载电子版本: | ||
gRPC 是 google 推出的跨平台和跨语言的RPC框架。 | ||
|
||
- 在线阅读 | ||
- [国外服务器][gitbook]:gitbook提供的托管,服务器在国外,速度比较慢,偶尔被墙,HTTPS | ||
- [国内服务器][qcloud]:腾讯云加速,国内网速极快,非HTTPS | ||
- [下载pdf格式][pdf] | ||
- [下载mobi格式][mobi] | ||
- [下载epub格式][epub] | ||
### 访问方式 | ||
|
||
本文内容可以任意转载,但是需要注明来源并提供链接。 | ||
这是个人学习grpc的笔记,请点击下面的链接阅读: | ||
|
||
**请勿用于商业出版**。 | ||
- [在线阅读](https://skyao.io/learning-grpc):hugo格式,界面清爽。托管于腾讯云香港节点,速度快,偶尔抽风 | ||
- [@github](https://github.com/skyao/learning-grpc/):源码托管于github,如有谬误或需讨论,请提issue,欢迎提交PR | ||
|
||
[gitbook]: https://skyao.gitbooks.io/learning-grpc/ | ||
[qcloud]: http://skyao.io/learning-grpc/ | ||
[pdf]: https://www.gitbook.com/download/pdf/book/skyao/learning-grpc | ||
[mobi]: https://www.gitbook.com/download/mobi/book/skyao/learning-grpc | ||
[epub]: https://www.gitbook.com/download/epub/book/skyao/learning-grpc | ||
### 版权申明 | ||
|
||
本笔记内容可以任意转载,但请注明来源并提供链接,**请勿用于商业出版**。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
baseurl = "http://localhost:1313/" | ||
uglyurls = true | ||
relativeURLs=false | ||
languageCode = "zh-cn" | ||
title = "gRPC学习笔记" | ||
theme = "hugo-material-docs" | ||
metadataformat = "yaml" | ||
canonifyurls = true | ||
preserveTaxonomyNames = true | ||
disablePathToLower = true | ||
|
||
# Enable Google Analytics by entering your tracking id | ||
googleAnalytics = "c7442f5794ea2abb71c6ff05dc0b8779" | ||
|
||
[params] | ||
# General information | ||
author = "敖小剑" | ||
keywords = "gRPC,学习笔记,敖小剑" | ||
description = "学习使用gRPC" | ||
copyright = "版权所有,转载请注明出处" | ||
|
||
# Repository | ||
provider = "GitHub" | ||
repo_url = "https://github.com/skyao/learning-grpc" | ||
|
||
version = "" | ||
logo = "images/logo.png" | ||
favicon = "" | ||
|
||
permalink = "#" | ||
# reward button, comment this to disable it | ||
reward = true | ||
|
||
# Custom assets | ||
custom_css = [] | ||
custom_js = [] | ||
|
||
# Syntax highlighting theme | ||
highlight_css = "" | ||
|
||
[params.palette] | ||
primary = "red" | ||
accent = "teal" | ||
|
||
[params.font] | ||
text = "Ubuntu" | ||
code = "Ubuntu Mono" | ||
|
||
[social] | ||
twitter = "" | ||
github = "skyao" | ||
email = "[email protected]" | ||
|
||
|
||
[[menu.main]] | ||
name = "前言" | ||
url = "/" | ||
weight = 1 | ||
|
||
[[menu.main]] | ||
name = "介绍" | ||
identifier = "introduction" | ||
url = "/introduction/" | ||
weight = 1000 | ||
|
||
[[menu.main]] | ||
name = "Name Resolver" | ||
identifier = "nameresolver" | ||
url = "/nameresolver/" | ||
weight = 10000 | ||
|
||
[[menu.main]] | ||
name = "设计及文档" | ||
identifier = "nameresolver-design" | ||
url = "/nameresolver/design" | ||
parent = "nameresolver" | ||
weight = 10200 | ||
|
||
|
||
[[menu.main]] | ||
name = "Naming Package" | ||
identifier = "nameresolver-naming" | ||
url = "/nameresolver/naming" | ||
parent = "nameresolver" | ||
weight = 10300 | ||
|
||
[[menu.main]] | ||
name = "Resolver Package" | ||
identifier = "nameresolver-resolver" | ||
url = "/nameresolver/resolver" | ||
parent = "nameresolver" | ||
weight = 10500 | ||
|
||
[blackfriday] | ||
smartypants = true | ||
fractions = true | ||
smartDashes = true | ||
plainIDAnchors = true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# gRPC学习笔记 | ||
|
||
### 内容介绍 | ||
|
||
gRPC 是 google 推出的跨平台和跨语言的RPC框架。 | ||
|
||
### 访问方式 | ||
|
||
这是个人学习grpc的笔记,请点击下面的链接阅读: | ||
|
||
- [在线阅读](https://skyao.io/learning-grpc):hugo格式,界面清爽。托管于腾讯云香港节点,速度快,偶尔抽风 | ||
- [@github](https://github.com/skyao/learning-grpc/):源码托管于github,如有谬误或需讨论,请提issue,欢迎提交PR | ||
|
||
### 版权申明 | ||
|
||
本笔记内容可以任意转载,但请注明来源并提供链接,**请勿用于商业出版**。 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
weight: 0 | ||
--- | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
date: 2018-09-29T06:59:00+08:00 | ||
title: gRPC介绍 | ||
weight: 1000 | ||
description : "介绍gRPC的基本信息" | ||
--- | ||
|
||
gRPC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
date: 2018-09-29T06:54:00+08:00 | ||
title: gRPC资料收集 | ||
weight: 1010 | ||
menu: | ||
main: | ||
parent: "introduction" | ||
description : "收集gRPC的各种资料" | ||
--- | ||
|
||
## 网站 | ||
|
||
- [grpc官网](http://www.grpc.io/) | ||
- [grpc-java](https://github.com/grpc/grpc-java) gRPC Java实现. | ||
- [javadoc](http://www.grpc.io/grpc-java/javadoc/index.html): grpc java 的javadoc地址 | ||
- [grpc google groups](https://groups.google.com/forum/#!forum/grpc-io) | ||
- [grpc-ecosystem](https://github.com/grpc-ecosystem) | ||
|
||
## 文档 | ||
|
||
- [grpc-common](http://github.com/grpc/grpc-common) 是官方提供的文档和例子, 但是内容实际是指向下面的grpc.io上的Documentation. | ||
- [[email protected]](http://www.grpc.io/docs/) 是grpc.io提供的文档,这个适合入门 | ||
|
||
[email protected]中内容比较重要: | ||
|
||
- [overview](http://www.grpc.io/docs/index.html): grpc的overview | ||
- [java教程](http://www.grpc.io/docs/tutorials/basic/java.html) 是官方提供的针对java的教程 | ||
|
||
> 注:开源中国组织人手翻译这份文档,[gRPC 官方文档中文版](http://doc.oschina.net/grpc?t=58011) | ||
## Demo | ||
|
||
- [grpc-android-demo](https://github.com/Lovoo/grpc-android-demo): andriod的demo | ||
- [grpc-streaming-demo](https://github.com/ridha/grpc-streaming-demo): A quick demo of bi-directional streaming RPC's using grpc, go and python | ||
- [yeyincai/grpc-demo](https://github.com/yeyincai/grpc-demo): introduces using grpc about encryption、stream、oneof、interceptor、loadbalance demo http://blog.csdn.net/yeyincai | ||
|
||
## 工具 | ||
|
||
- [grpc-tools](https://github.com/grpc/grpc-tools): Tools useful with gRPC libraries, provided by grpc | ||
|
||
## 项目 | ||
|
||
- [kafka-pixy](https://github.com/mailgun/kafka-pixy): gRPC/REST proxy for Kafka | ||
- [grpc-experiments](https://github.com/grpc/grpc-experiments): Experiments and proposals for gRPC features. | ||
- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway): gRPC to JSON proxy generator | ||
- [LogNet/grpc-spring-boot-starter](https://github.com/LogNet/grpc-spring-boot-starter): Spring Boot starter module for gRPC framework. | ||
- [grpc-opentracing](https://github.com/grpc-ecosystem/grpc-opentracing): OpenTracing is a set of consistent, expressive, vendor-neutral APIs for distributed tracing and context propagation | ||
|
||
## 周边项目 | ||
|
||
- [grpc-gateway](https://github.com/gengo/grpc-gateway): 是一个基于go语言的项目. | ||
|
||
> grpc-gateway是protoc的插件. 它读取gRPC 服务定义, 然后生成一个反向代理服务器, 将RESTful JSON API转为gRPC. | ||
> | ||
> 用于帮助为API同时提供gRPC 和 RESTful接口. | ||
这个工具似乎不错,对于某些需要提供restul接口场合可以快速的在grpc接口上转换出来. | ||
|
||
- [grpc-docker-library](https://github.com/grpc/grpc-docker-library): 包含官方gRPC Docker镜像的Git仓库 | ||
|
||
- [grpc-spring-boot-starter](https://github.com/yidongnan/grpc-spring-boot-starter): 介绍 [gRPC Spring Boot Starter - SprintBoot 的 gRPC 模块](https://www.v2ex.com/t/343538) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
weight: 0 | ||
--- | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
weight: 0 | ||
--- | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
date: 2018-09-29T06:54:00+08:00 | ||
title: 文档:gRPC名称解析 | ||
weight: 10110 | ||
menu: | ||
main: | ||
parent: "nameresolver-design" | ||
description : "gRPC名称解析" | ||
--- | ||
|
||
> https://github.com/grpc/grpc/blob/master/doc/naming.md | ||
## 概述 | ||
|
||
gRPC支持DNS作为默认的名称系统。在不同的部署中,有许多替代的名称系统被使用。我们支持一个足够通用的API,以支持一系列的名称系统和相应的名称语法。各种语言的 gRPC 客户端库将提供一个插件机制,因此可以插入不同名称系统的解析器。 | ||
|
||
## 详细设计 | ||
|
||
### 名称语法 | ||
|
||
用于 gRPC channel 构建的完全限定的自包含名称,使用 RFC 3986中定义的URI语法。 | ||
|
||
URI schema 指示要使用的解析器插件,如果没有指定schema前缀或schema未知,默认使用dns方案。 | ||
|
||
URI路径表示要解析的名称。 | ||
|
||
大多数 gRPC 实现都支持以下URI schema: | ||
|
||
|
||
- `dns:[//authority/]host[:port]` -- DNS (默认) | ||
- `host` 是要通过DNS解析的主机名 | ||
- `port` 是要为每个地址返回的端口,如果没有指定,则使用443 (但是某些实现对于非加密channel默认使用80) | ||
- `authority` 表示要使用的 DNS 服务器,尽管这只被一些实现所支持。在C-core中,默认的DNS解析器不支持这个功能,但基于c-ares的解析器支持以 "IP:port "的形式指定这个功能)。 | ||
|
||
- `unix:path` or `unix://absolute_path` -- Unix domain sockets (Unix systems only) | ||
- `path` 表示所需socket的位置。 | ||
- 在第一种形式中,路径可以是相对的,也可以是绝对的;在第二种形式中,路径必须是绝对的(即实际上会有三个斜线,两个在path之前,另一个用来开始绝对路径)。 | ||
|
||
gRPC C-core实现支持以下方案,但其他语言可能不支持: | ||
|
||
- `ipv4:address[:port][,address[:port],...]` -- IPv4 addresses | ||
- 可以指定多个逗号分隔的地址,地址形式为`address[:port]` | ||
|
||
- `address` 是使用的 IPv4 地址 | ||
- `port` 是使用的端口。如果没有指定,使用443 | ||
|
||
- `ipv6:address[:port][,address[:port],...]` -- IPv6 addresses | ||
- 可以指定多个逗号分隔的地址,地址形式为`address[:port]` | ||
- `address` 是使用的 IPv6 地址. 要使用 `port` 则地址 `address` 必须用中括号 (`[` and `]`)包起来. 例如: | ||
`ipv6:[2607:f8b0:400e:c00::ef]:443` or `ipv6:[::]:1234` | ||
- `port`是使用的端口。如果没有指定,使用443 | ||
|
||
今后还可以增加其他schema,如 "etcd"。 | ||
|
||
### Resolver 插件 | ||
|
||
gRPC客户端类库将使用指定的schema来挑选合适的解析器插件,并将完全限定的名称字符串传递给它。 | ||
|
||
解析器应该能够联系权威机构(authority)并得到解析,然后将其返回给gRPC客户端类库。返回的内容包括: | ||
|
||
- 解析的地址列表(包括IP地址和端口)。每个地址可以有一组与之相关的任意属性(键/值对),这些属性可用于从解析器向负载均衡策略传递信息。 | ||
|
||
- service config | ||
|
||
插件API允许解析器持续观察一个端点,并根据需要返回更新的解析。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
date: 2018-09-29T06:59:00+08:00 | ||
title: 名称解析的设计及文档 | ||
weight: 10100 | ||
description : "介绍名称解析的设计及文档" | ||
--- | ||
|
||
|
||
|
||
### 名称解析 | ||
|
||
- 文档:gRPC服务配置 | ||
|
||
### 服务配置 | ||
|
||
- 文档:gRPC服务配置 | ||
|
||
- [Proposal:Service Configs in DNS](https://github.com/grpc/proposal/blob/master/A2-service-configs-in-dns.md): 关于此提案的讨论在 https://groups.google.com/g/grpc-io/c/DkweyrWEXxU/discussion | ||
- [Proposal: Service Config Error Handling](https://github.com/grpc/proposal/blob/master/A21-service-config-error-handling.md) | ||
|
||
- [service_config.proto](https://github.com/grpc/grpc-proto/blob/master/grpc/service_config/service_config.proto): 超长内容,xds的配置也在里面 | ||
|
Oops, something went wrong.