-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from yusank/dev
Merge dev into main
- Loading branch information
Showing
19 changed files
with
367 additions
and
49 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
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
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
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
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
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,3 +1,80 @@ | ||
--- | ||
weight: 1 | ||
--- | ||
|
||
# Configuration | ||
|
||
> config | ||
配置为两份文件分别为 service config 和 registry config | ||
|
||
- service config 关注服务启停以及声明周期中需要的各类配置 | ||
- registry config 关注服务注册相关配置 | ||
|
||
## server config definition | ||
|
||
```proto | ||
// Service 为一个服务的全部配置 | ||
message Service { | ||
string name = 1; | ||
string version = 2; | ||
optional Server http = 3; | ||
optional Server grpc = 4; | ||
Log log = 5; | ||
map<string, string> metadata = 6; | ||
Redis redis = 7; | ||
MQ mq = 8; | ||
} | ||
message Server { | ||
string scheme = 1; | ||
string addr = 2; | ||
int32 port = 3; | ||
} | ||
enum Level { | ||
DEBUG = 0; | ||
INFO = 1; | ||
WARING = 2; | ||
ERROR = 3; | ||
FATAL = 4; | ||
} | ||
message Log { | ||
optional string log_path = 1; | ||
repeated Level level = 2; | ||
} | ||
message Redis { | ||
string addr = 1; | ||
string password = 2; | ||
int32 max_conns = 3; | ||
int32 min_idle_conns = 4; | ||
google.protobuf.Duration dial_timeout = 5; | ||
google.protobuf.Duration idle_timeout = 6; | ||
} | ||
message MQ { | ||
repeated string addr = 1; | ||
int32 max_retry = 2; | ||
} | ||
``` | ||
|
||
## registry config definition | ||
|
||
```proto | ||
message RegistryInfo { | ||
repeated string addr = 1; | ||
string scheme = 2; | ||
google.protobuf.Duration dial_timeout_sec = 3; | ||
google.protobuf.Duration dial_keep_alive_time_sec = 4; | ||
google.protobuf.Duration dial_keep_alive_timeout_sec = 5; | ||
} | ||
message Registry { | ||
string name = 1; | ||
oneof reg { | ||
RegistryInfo consul = 2; | ||
RegistryInfo etcd = 3; | ||
} | ||
} | ||
``` |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
--- | ||
title: "Terminal CLI" | ||
--- | ||
|
||
## How to run it | ||
|
||
服务提供一个简单的终端 GUI 可以测试消息的发送和接受,代码在 `tests` 目录下。 | ||
|
||
在 `goim/test` 目录下执行如下命令: | ||
|
||
```shell | ||
# 支持参数 | ||
# ADDR ?= 127.0.0.1:18071 | ||
# UID ?= user1 | ||
# TOUID ?= user2 | ||
|
||
make run-gui UID=user3 TOUID=user2 | ||
``` | ||
|
||
界面如下: | ||
|
||
![gui](./gui.png) |
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
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
Oops, something went wrong.