Skip to content

Commit

Permalink
格式check改动
Browse files Browse the repository at this point in the history
  • Loading branch information
lhq01844380@antgroup.com committed Jun 28, 2024
1 parent 1537b68 commit 3be311e
Show file tree
Hide file tree
Showing 32 changed files with 70 additions and 81 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ None of these is essential for a pull request, but they will all help.
9. Make sure checks have been correctly passed, you can simply run `make check`
10. Contribute a Pull Request as the rule of Github Workflow, and you should follow the pull request's rules.

> Layotto provides many useful commands to help you contribute easier, please check it [here](docs/en/development/commands.md)
> Layotto provides many useful commands to help you contribute easier, please check it [here](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/commands.md)
## Version naming convention

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ Layotto enriches the <a href="https://landscape.cncf.io/serverless">CNCF CLOUD N
As a programming enthusiast , have you ever felt that you want to participate in the development of an open source project, but don't know where to start?
In order to help everyone better participate in open source projects, our community will regularly publish community tasks to help everyone learn by doing!

[Document Contribution Guide](docs/en/development/contributing-doc.md)
[Document Contribution Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/contributing-doc.md)

[Component Development Guide](docs/en/development/developing-component.md)
[Component Development Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/developing-component.md)

[Layotto Github Workflows](docs/en/development/github-workflows.md)
[Layotto Github Workflows](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/github-workflows.md)

[Layotto Commands Guide](docs/en/development/commands.md)
[Layotto Commands Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/commands.md)

[Layotto Contributor Guide](docs/en/development/CONTRIBUTING.md)
[Layotto Contributor Guide](docs/i18n/en-US/docusaurus-plugin-content-docs/current/development/CONTRIBUTING.md)

## Contributors

Expand All @@ -157,17 +157,17 @@ Thank y'all!

## Design Documents

[Actuator Design Doc](docs/en/design/actuator/actuator-design-doc.md)
[Actuator Design Doc](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/actuator/actuator-design-doc.md)

[Configuration API with Apollo](docs/en/design/configuration/configuration-api-with-apollo.md)
[Configuration API with Apollo](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/configuration/configuration-api-with-apollo.md)

[Pubsub API and Compability with Dapr Component](docs/en/design/pubsub/pubsub-api-and-compability-with-dapr-component.md)
[Pubsub API and Compability with Dapr Component](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/pubsub/pubsub-api-and-compability-with-dapr-component.md)

[RPC Design Doc](docs/en/design/rpc/rpc-design-doc.md)
[RPC Design Doc](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/rpc/rpc-design-doc.md)

[Distributed Lock API Design](docs/en/design/lock/lock-api-design.md)
[Distributed Lock API Design](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/lock/lock-api-design.md)

[FaaS Design](docs/en/design/faas/faas-poc-design.md)
[FaaS Design](docs/i18n/en-US/docusaurus-plugin-content-docs/current/design/faas/faas-poc-design.md)

## FAQ

Expand Down
2 changes: 0 additions & 2 deletions docs/blog/code/layotto-rpc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,7 @@ func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byt
最终收到返回数据:
```json

Check failure on line 938 in docs/blog/code/layotto-rpc/index.md

View workflow job for this annotation

GitHub Actions / Markdown Validation

Fenced code blocks should be surrounded by blank lines [Context: "```json"]

{"jsonrpc":"2.0","id":9527,"result":{"id":"113","name":"Moorse","age":30,"time":703394193,"sex":"MAN"}}

```
## 总结
Expand Down
5 changes: 3 additions & 2 deletions docs/docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Layotto (L8): To be the next layer of OSI layer 7
<img src="https://gw.alipayobjects.com/zos/bmw-prod/65518bfc-8ba5-4234-a5c5-2bc065e3a5f0.svg" height="120px"/>

[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml)
[//]: # ([![Layotto Env Pipeline 🌊]&#40;https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml/badge.svg&#41;]&#40;https://github.com/mosn/layotto/actions/workflows/quickstart-checker.yml&#41;)
[![Layotto Env Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/proto-checker.yml)
[![Layotto Dev Pipeline 🌊](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml/badge.svg)](https://github.com/mosn/layotto/actions/workflows/layotto-ci.yml)

[![GoDoc](https://godoc.org/mosn.io/layotto?status.svg)](https://godoc.org/mosn.io/layotto)
Expand Down Expand Up @@ -178,6 +179,6 @@ Layotto enriches the <a href="https://landscape.cncf.io/serverless">CNCF CLOUD N

## FAQ

## 跟 dapr 有什么差异?
### 跟 dapr 有什么差异?

dapr 是一款优秀的 Runtime 产品,但它本身缺失了 Service Mesh 的能力,而这部分能力对于实际在生产环境落地是至关重要的,因此我们希望把 Runtime 跟 Service Mesh 两种能力结合在一起,满足更复杂的生产落地需求。
2 changes: 1 addition & 1 deletion docs/docs/component_specs/configuration/apollo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 配置项说明
示例:configs/config_apollo.json
![img.png]((/img/configuration/apollo/img.png)
![img.png](/img/configuration/apollo/img.png)

| 字段 | 必填 | 说明 |
| --- | --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/component_specs/configuration/nacos.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

不过不是添加在 nacos configstore 组件的配置里,添加在而外的配置项中,方便其他需要使用 `app_id` 的组件复用。

![img.png]((/img/configuration/nacos/img.png)
![img.png](/img/configuration/nacos/img.png)

## 怎么启动 Nacos

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/component_specs/file/tencentcloud_oss.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

访问 https://console.cloud.tencent.com/cos/bucket 创建存储桶

![]((/img/file/create_tencent_oss_bucket.png)
![](/img/file/create_tencent_oss_bucket.png)

3.创建 AK 和 SK

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/configuration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Layotto 启动时需要读取一个 json 格式的配置文件。示例配置文

目前,Layotto使用一个MOSN 4层filter与MOSN集成、跑在MOSN上,**所以Layotto用到的配置文件其实就是MOSN配置文件。**

![img.png]((/img/configuration/layotto/img.png)
![img.png](/img/configuration/layotto/img.png)

如上图示例,大部分配置是MOSN的配置项,参考[MOSN的配置说明](https://mosn.io/docs/configuration/) ;

Expand Down
2 changes: 0 additions & 2 deletions docs/docs/design/faas/faas-poc-design.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# FaaS设计文档

## FaaS设计

### 一、架构设计

Check failure on line 3 in docs/docs/design/faas/faas-poc-design.md

View workflow job for this annotation

GitHub Actions / Markdown Validation

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]

![img.png](../(/img/faas/faas-design.jpg)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/design/rpc/rpc_design_document.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RPC 设计文档
## RPC 设计

### API 设计

Check failure on line 3 in docs/docs/design/rpc/rpc_design_document.md

View workflow job for this annotation

GitHub Actions / Markdown Validation

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
[layotto rpc API](https://github.com/mosn/layotto/blob/f70cdc619693ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto#L19https://github.com/mosn/layotto/blob/f70cdc619693ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto#L19) 与Dapr保持一致.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/development/component_ref/component_ref.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# layotto组件引用

## 背景
### 背景

Check failure on line 3 in docs/docs/development/component_ref/component_ref.md

View workflow job for this annotation

GitHub Actions / Markdown Validation

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]

组件初始化的时候,需要引用其他组件的能力,比如sequencer组件初始化的时候需要从config组件读取相关的配置,以此实现组件之间的引用。

Expand Down
14 changes: 7 additions & 7 deletions docs/docs/development/contributing-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

文档统一放在docs/目录下,其中docs/en存放英文文档,docs/zh存放中文文档。

![img_2.png]((/img/development/doc/img_2.png)
![img_2.png](/img/development/doc/img_2.png)

## 2. 文档站点说明
docs/目录下的文件,会被自动部署到github pages,通过[docsify](https://docsify.js.org/#/) 渲染。
Expand Down Expand Up @@ -39,7 +39,7 @@ step 3. 打开 http://localhost:3000/ 查看文档站点。
### step 1. 新建 markdown 文档
当需要新增文档时,可以按目录结构新建文件夹、新建.md文件。比如想写分布式锁API的设计文档,就新建目录:

![img_1.png]((/img/development/doc/img_1.png)
![img_1.png](/img/development/doc/img_1.png)

### step 2. 把文档加入侧边栏
新增文档、写完内容后,记得更新一下侧边栏哦。
Expand All @@ -60,22 +60,22 @@ step 3. 打开 http://localhost:3000/ 查看文档站点。

这里说的超链接是那种点了后会跳转到其他文档的链接,比如下面这种:

![img_4.png]((/img/development/doc/img_4.png)
![img_4.png](/img/development/doc/img_4.png)

### 4.1. 错误的写法
如果你尝试用相对路径写超链接url,会发现在站点里点击他就会404:

![img_6.png]((/img/development/doc/img_6.png)
![img_6.png](/img/development/doc/img_6.png)

![img_7.png]((/img/development/doc/img_7.png)
![img_7.png](/img/development/doc/img_7.png)

### 4.2. 正确的写法

有两种正确的方式使用超链接:

a. 用相对于docs/目录的相对路径。例如:

![img_5.png]((/img/development/doc/img_5.png)
![img_5.png](/img/development/doc/img_5.png)

b. 用完整的Url。例如:

Expand All @@ -86,7 +86,7 @@ see [runtime_config.json](https://github.com/mosn/layotto/blob/main/configs/runt
## 5. 图片目录与图片链接
图片放在docs/img/ 目录下。放这里是为了能让docsify站点能访问到:

![img.png]((/img/development/doc/img.png)
![img.png](/img/development/doc/img.png)

文档中引用图片建议就用完整路径,免得遇到一堆乱七八糟的路径问题。

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/development/developing-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

A: 目前缺少使用文档,用户不好用,例如:

![img_1.png]((/img/development/api/img_1.png)
![img_1.png](/img/development/api/img_1.png)

![img_2.png]((/img/development/api/img_2.png)
![img_2.png](/img/development/api/img_2.png)

代码缺少注释,感兴趣的贡献者看不懂,例如 https://github.com/mosn/layotto/issues/112

Expand Down Expand Up @@ -79,7 +79,7 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比

正例:[Dapr pub-sub quickstart](https://github.com/dapr/quickstarts/tree/v1.0.0/pub-sub) 在操作之前贴图解释下要做什么事情

![img.png]((/img/development/api/img.png)
![img.png](/img/development/api/img.png)

反例:文档只写了操作步骤1234,用户看不懂操作这些想干啥

Expand All @@ -103,7 +103,7 @@ A: **本规范只限制“新增Layotto API的pr需要有哪些东西”(比
##### how.怎么用这个API
- 接口列表。例如:

![img_4.png]((/img/development/api/img_4.png)
![img_4.png](/img/development/api/img_4.png)

列出来有哪些接口,一方面省的用户自己去翻proto、不知道哪些是相关API,一方面避免用户产生"这项目连接口文档都没有?!"的反感
- 关于接口的出入参:拿proto注释当接口文档
Expand Down
26 changes: 13 additions & 13 deletions docs/docs/development/developing-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

文件夹名用组件名就行,比如redis的组件如下图

![img.png]((/img/development/component/img.png)
![img.png](/img/development/component/img.png)

开发过程中可能用到的工具类(不是强制一定要用哈,列在这只是供参考,希望能简化开发):

Expand All @@ -45,22 +45,22 @@

首先,在configstore.go里,把所有调sdk、发起网络调用调apollo的地方给封装成一个interface

![mock.png]((/img/development/component/mock.png)
![img_8.png]((/img/development/component/img_8.png)
![mock.png](/img/development/component/mock.png)
![img_8.png](/img/development/component/img_8.png)

然后,把你代码中调sdk、做网络调用的代码封装成一个struct、实现刚才的interface:

![img_9.png]((/img/development/component/img_9.png)
![img_9.png](/img/development/component/img_9.png)

做了这一步重构后,你的代码就有可测性了(这也是"测试驱动开发"思想的一种体现,为了让代码可测性好,把代码重构成可以依赖注入的形式)

接下来,写ut的时候,可以mock刚才的interface:

![img_10.png]((/img/development/component/img_10.png)
![img_10.png](/img/development/component/img_10.png)

把mock后的东西注入到要测的struct里就行,然后测那个struct就行

![img_11.png]((/img/development/component/img_11.png)
![img_11.png](/img/development/component/img_11.png)

注:一般“集成测试”的时候,会真正做网络调用、调一个正常的zookeeper或者redis;而单测注重测局部逻辑,不会调真实环境

Expand All @@ -72,10 +72,10 @@

需要在cmd/layotto/main.go里集成进新的组件,包括:
### 3.1. 在main.go里import你的组件
![img_1.png]((/img/development/component/img_1.png)
![img_1.png](/img/development/component/img_1.png)

### 3.2. 在main.go的NewRuntimeGrpcServer函数中注册你的组件
![img_4.png]((/img/development/component/img_4.png)
![img_4.png](/img/development/component/img_4.png)

之后,用户如果在Layotto配置文件中配置了"我要用zookeeper",那么Layotto就会初始化zookeeper组件

Expand All @@ -93,7 +93,7 @@

之后编辑修改一下图中的配置:

![img_3.png]((/img/development/component/img_3.png)
![img_3.png](/img/development/component/img_3.png)



Expand All @@ -103,12 +103,12 @@
#### a. 如果该组件有通用客户端,就不用开发啦
如果demo目录下有common文件夹,代表这是个通用demo、能给不同的组件用,可以通过命令行传参传storeName,有这个就不用再开发demo啦

![img_6.png]((/img/development/component/img_6.png)
![img_6.png](/img/development/component/img_6.png)

#### b. 如果该组件没有通用客户端,或者需要定制一些metadata传参,那就复制粘贴改一改
比如zookeeper实现分布式锁,有一些定制配置,所以想自己新写个demo,那就复制粘贴redis的demo、改一改

![img_7.png]((/img/development/component/img_7.png)
![img_7.png](/img/development/component/img_7.png)

注:demo的代码里如果出现不该有的错误,可以直接panic。后续我们会直接用demo跑集成测试,如果panic了代表集成测试没有通过。
例如demo/lock/redis/client.go 里:
Expand All @@ -127,11 +127,11 @@

注:下面这个Error没事,无视就好

![img_2.png]((/img/development/component/img_2.png)
![img_2.png](/img/development/component/img_2.png)

启动demo、调用Layotto,看看有没有报错。如果是通用客户端,可以在命令行命令里带上-s storeName传入storeName

![img_5.png]((/img/development/component/img_5.png)
![img_5.png](/img/development/component/img_5.png)

没有报错的话说明测试通过!

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/development/github-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Layotto Env Pipeline 流水线任务触发方式:

## Layotto Dev Pipeline 🌊 (Before Merged)

![release.png]((/img/development/workflow/workflow-dev.png)
![release.png](/img/development/workflow/workflow-dev.png)

### Job 任务内容

Expand Down Expand Up @@ -118,7 +118,7 @@ Layotto Dev Pipeline (Before Merged) 流水线主要负责 Layotto 提交 PR 后

## Layotto Dev Pipeline 🌊 (After Merged)

![release.png]((/img/development/workflow/workflow-merge.png)
![release.png](/img/development/workflow/workflow-merge.png)

### Job 任务内容

Expand Down Expand Up @@ -157,7 +157,7 @@ Layotto Dev Pipeline (After Merged) 流水线主要负责 Layotto 代码合并

## Layotto Release Pipeline 🌊

![release.png]((/img/development/workflow/work(/img/lease.png)
![release.png](/img/development/workflow/work(/img/lease.png)

### Job 任务内容

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/development/release-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ Layotto 发布周期暂定为每季度发布一次。
+ AMD64/X86 架构的镜像:`layotto/layotto:{tag}`
+ ARM64 架构的镜像:`layotto/layotto.arm64:{tag}`

![release.png]((/img/development/workflow/release.png)
![release.png](/img/development/workflow/release.png)

### Step3: Draft a new release 并编写发布报告

> 发布报告可以先用 github 的功能自动生成,再基于生成的内容做修改。
> 可以参考以前的 [发版报告](https://github.com/mosn/layotto/releases)
![img_1.png]((/img/development/release/img_1.png)
![img_1.png](/img/development/release/img_1.png)

### Step4: 上传多平台架构的 Binaries
> 2022/05/04更新:这一步可以忽略。打 tag 发布后,Layotto 的 Release Pipeline 会自动上传二进制文件,无需手动上传。PR 见 https://github.com/mosn/layotto/pull/566
> 如果没有自动上传,可以手动将 `步骤 2` 中构建的多平台 Artifacts 下载、上传
![img.png]((/img/development/release/img.png)
![img.png](/img/development/release/img.png)

### Step5: 确认发布

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/start/faas/start.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FaaS 快速开始

## 一、功能介绍
### 一、功能介绍

Check failure on line 3 in docs/docs/start/faas/start.md

View workflow job for this annotation

GitHub Actions / Markdown Validation

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]

Layotto支持加载并运行以 wasm 为载体的 Function,并支持Function之间互相调用以及访问基础设施,如Redis。

Expand Down
3 changes: 0 additions & 3 deletions docs/docs/start/wasm/start.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# 将业务逻辑通过WASM下沉进sidecar

## sidecar

### 功能介绍

Check failure on line 2 in docs/docs/start/wasm/start.md

View workflow job for this annotation

GitHub Actions / Markdown Validation

Heading levels should only increment by one level at a time [Expected: h2; Actual: h3]
service mesh 和 multi-runtime 的 sidecar 是全公司通用的基础设施,但实践中,业务系统也会有自己的sdk,也会有推动用户升级难、版本碎片的问题.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

### runtime analysis

Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the`:'
Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the `:'

```
type MosnRuntime struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

### runtime analysis

Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the`:'
Look at the structure of runtime, the composition of the `runtime' at the aggregate level of the `:'

```
type MosnRuntime struct {
Expand Down
Loading

0 comments on commit 3be311e

Please sign in to comment.