Skip to content

Commit

Permalink
docs: 优化 README.md 导航中无法跳转结构体的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Jan 15, 2024
1 parent bd7a3fe commit e7e679e
Show file tree
Hide file tree
Showing 51 changed files with 480 additions and 240 deletions.
6 changes: 4 additions & 2 deletions configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ configuration 基于配置导表功能实现的配置加载及刷新功能
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[RefreshEventHandle](#refresheventhandle)|配置刷新事件处理函数
|`INTERFACE`|[Loader](#loader)|配置加载器
|`STRUCT`|[RefreshEventHandle](#struct_RefreshEventHandle)|配置刷新事件处理函数
|`INTERFACE`|[Loader](#struct_Loader)|配置加载器

</details>

Expand Down Expand Up @@ -75,11 +75,13 @@ configuration 基于配置导表功能实现的配置加载及刷新功能
<span id="OnConfigRefreshEvent"></span>

***
<span id="struct_RefreshEventHandle"></span>
### RefreshEventHandle `STRUCT`
配置刷新事件处理函数
```go
type RefreshEventHandle func()
```
<span id="struct_Loader"></span>
### Loader `INTERFACE`
配置加载器
```go
Expand Down
33 changes: 22 additions & 11 deletions game/activity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ activity 活动状态管理
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Activity](#activity)|活动描述
|`STRUCT`|[Controller](#controller)|活动控制器
|`INTERFACE`|[BasicActivityController](#basicactivitycontroller)|暂无描述...
|`INTERFACE`|[NoneDataActivityController](#nonedataactivitycontroller)|无数据活动控制器
|`INTERFACE`|[GlobalDataActivityController](#globaldataactivitycontroller)|全局数据活动控制器
|`INTERFACE`|[EntityDataActivityController](#entitydataactivitycontroller)|实体数据活动控制器
|`INTERFACE`|[GlobalAndEntityDataActivityController](#globalandentitydataactivitycontroller)|全局数据和实体数据活动控制器
|`STRUCT`|[DataMeta](#datameta)|全局活动数据
|`STRUCT`|[EntityDataMeta](#entitydatameta)|活动实体数据
|`STRUCT`|[UpcomingEventHandler](#upcomingeventhandler)|暂无描述...
|`STRUCT`|[Options](#options)|活动选项
|`STRUCT`|[Activity](#struct_Activity)|活动描述
|`STRUCT`|[Controller](#struct_Controller)|活动控制器
|`INTERFACE`|[BasicActivityController](#struct_BasicActivityController)|暂无描述...
|`INTERFACE`|[NoneDataActivityController](#struct_NoneDataActivityController)|无数据活动控制器
|`INTERFACE`|[GlobalDataActivityController](#struct_GlobalDataActivityController)|全局数据活动控制器
|`INTERFACE`|[EntityDataActivityController](#struct_EntityDataActivityController)|实体数据活动控制器
|`INTERFACE`|[GlobalAndEntityDataActivityController](#struct_GlobalAndEntityDataActivityController)|全局数据和实体数据活动控制器
|`STRUCT`|[DataMeta](#struct_DataMeta)|全局活动数据
|`STRUCT`|[EntityDataMeta](#struct_EntityDataMeta)|活动实体数据
|`STRUCT`|[UpcomingEventHandler](#struct_UpcomingEventHandler)|暂无描述...
|`STRUCT`|[Options](#struct_Options)|活动选项

</details>

Expand Down Expand Up @@ -166,6 +166,7 @@ activity 活动状态管理
> 创建活动选项
***
<span id="struct_Activity"></span>
### Activity `STRUCT`
活动描述
```go
Expand All @@ -185,6 +186,7 @@ type Activity[Type generic.Basic, ID generic.Basic] struct {
initializeData func()
}
```
<span id="struct_Controller"></span>
### Controller `STRUCT`
活动控制器
```go
Expand All @@ -199,6 +201,7 @@ type Controller[Type generic.Basic, ID generic.Basic, Data any, EntityID generic
mutex sync.RWMutex
}
```
<span id="struct_BasicActivityController"></span>
### BasicActivityController `INTERFACE`

```go
Expand All @@ -209,6 +212,7 @@ type BasicActivityController[Type generic.Basic, ID generic.Basic, Data any, Ent
Refresh(activityId ID)
}
```
<span id="struct_NoneDataActivityController"></span>
### NoneDataActivityController `INTERFACE`
无数据活动控制器
```go
Expand All @@ -217,6 +221,7 @@ type NoneDataActivityController[Type generic.Basic, ID generic.Basic, Data any,
InitializeNoneData(handler func(activityId ID, data *DataMeta[Data])) NoneDataActivityController[Type, ID, Data, EntityID, EntityData]
}
```
<span id="struct_GlobalDataActivityController"></span>
### GlobalDataActivityController `INTERFACE`
全局数据活动控制器
```go
Expand All @@ -226,6 +231,7 @@ type GlobalDataActivityController[Type generic.Basic, ID generic.Basic, Data any
InitializeGlobalData(handler func(activityId ID, data *DataMeta[Data])) GlobalDataActivityController[Type, ID, Data, EntityID, EntityData]
}
```
<span id="struct_EntityDataActivityController"></span>
### EntityDataActivityController `INTERFACE`
实体数据活动控制器
```go
Expand All @@ -235,6 +241,7 @@ type EntityDataActivityController[Type generic.Basic, ID generic.Basic, Data any
InitializeEntityData(handler func(activityId ID, entityId EntityID, data *EntityDataMeta[EntityData])) EntityDataActivityController[Type, ID, Data, EntityID, EntityData]
}
```
<span id="struct_GlobalAndEntityDataActivityController"></span>
### GlobalAndEntityDataActivityController `INTERFACE`
全局数据和实体数据活动控制器
```go
Expand All @@ -245,6 +252,7 @@ type GlobalAndEntityDataActivityController[Type generic.Basic, ID generic.Basic,
InitializeGlobalAndEntityData(handler func(activityId ID, data *DataMeta[Data]), entityHandler func(activityId ID, entityId EntityID, data *EntityDataMeta[EntityData])) GlobalAndEntityDataActivityController[Type, ID, Data, EntityID, EntityData]
}
```
<span id="struct_DataMeta"></span>
### DataMeta `STRUCT`
全局活动数据
```go
Expand All @@ -254,6 +262,7 @@ type DataMeta[Data any] struct {
LastNewDay time.Time
}
```
<span id="struct_EntityDataMeta"></span>
### EntityDataMeta `STRUCT`
活动实体数据
```go
Expand All @@ -263,11 +272,13 @@ type EntityDataMeta[Data any] struct {
LastNewDay time.Time
}
```
<span id="struct_UpcomingEventHandler"></span>
### UpcomingEventHandler `STRUCT`

```go
type UpcomingEventHandler[ID generic.Basic] func(activityId ID)
```
<span id="struct_Options"></span>
### Options `STRUCT`
活动选项
```go
Expand Down
3 changes: 2 additions & 1 deletion game/activity/internal/example/types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[DemoActivityData](#demoactivitydata)|暂无描述...
|`STRUCT`|[DemoActivityData](#struct_DemoActivityData)|暂无描述...

</details>


***
## 详情信息
<span id="struct_DemoActivityData"></span>
### DemoActivityData `STRUCT`

```go
Expand Down
15 changes: 10 additions & 5 deletions game/fight/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[TurnBased](#turnbased)|回合制
|`INTERFACE`|[TurnBasedControllerInfo](#turnbasedcontrollerinfo)|暂无描述...
|`INTERFACE`|[TurnBasedControllerAction](#turnbasedcontrolleraction)|暂无描述...
|`STRUCT`|[TurnBasedController](#turnbasedcontroller)|回合制控制器
|`STRUCT`|[TurnBasedEntitySwitchEventHandler](#turnbasedentityswitcheventhandler)|暂无描述...
|`STRUCT`|[TurnBased](#struct_TurnBased)|回合制
|`INTERFACE`|[TurnBasedControllerInfo](#struct_TurnBasedControllerInfo)|暂无描述...
|`INTERFACE`|[TurnBasedControllerAction](#struct_TurnBasedControllerAction)|暂无描述...
|`STRUCT`|[TurnBasedController](#struct_TurnBasedController)|回合制控制器
|`STRUCT`|[TurnBasedEntitySwitchEventHandler](#struct_TurnBasedEntitySwitchEventHandler)|暂无描述...

</details>

Expand All @@ -40,6 +40,7 @@
> - calcNextTurnDuration 将返回下一次行动时间间隔,适用于按照速度计算下一次行动时间间隔的情况。当返回 0 时,将使用默认的行动超时时间
***
<span id="struct_TurnBased"></span>
### TurnBased `STRUCT`
回合制
```go
Expand All @@ -64,6 +65,7 @@ type TurnBased[CampID comparable, EntityID comparable, Camp generic.IdR[CampID],
closed bool
}
```
<span id="struct_TurnBasedControllerInfo"></span>
### TurnBasedControllerInfo `INTERFACE`

```go
Expand All @@ -77,6 +79,7 @@ type TurnBasedControllerInfo[CampID comparable, EntityID comparable, Camp generi
Stop()
}
```
<span id="struct_TurnBasedControllerAction"></span>
### TurnBasedControllerAction `INTERFACE`

```go
Expand All @@ -86,13 +89,15 @@ type TurnBasedControllerAction[CampID comparable, EntityID comparable, Camp gene
Refresh(duration time.Duration) time.Time
}
```
<span id="struct_TurnBasedController"></span>
### TurnBasedController `STRUCT`
回合制控制器
```go
type TurnBasedController[CampID comparable, EntityID comparable, Camp generic.IdR[CampID], Entity generic.IdR[EntityID]] struct {
tb *TurnBased[CampID, EntityID, Camp, Entity]
}
```
<span id="struct_TurnBasedEntitySwitchEventHandler"></span>
### TurnBasedEntitySwitchEventHandler `STRUCT`

```go
Expand Down
12 changes: 8 additions & 4 deletions game/space/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ space 游戏中常见的空间设计,例如房间、地图等
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[RoomController](#roomcontroller)|对房间进行操作的控制器,由 RoomManager 接管后返回
|`STRUCT`|[RoomManager](#roommanager)|房间管理器是用于对房间进行管理的基本单元,通过该实例可以对房间进行增删改查等操作
|`STRUCT`|[RoomAssumeControlEventHandle](#roomassumecontroleventhandle)|暂无描述...
|`STRUCT`|[RoomControllerOptions](#roomcontrolleroptions)|暂无描述...
|`STRUCT`|[RoomController](#struct_RoomController)|对房间进行操作的控制器,由 RoomManager 接管后返回
|`STRUCT`|[RoomManager](#struct_RoomManager)|房间管理器是用于对房间进行管理的基本单元,通过该实例可以对房间进行增删改查等操作
|`STRUCT`|[RoomAssumeControlEventHandle](#struct_RoomAssumeControlEventHandle)|暂无描述...
|`STRUCT`|[RoomControllerOptions](#struct_RoomControllerOptions)|暂无描述...

</details>

Expand All @@ -54,6 +54,7 @@ func ExampleNewRoomManager() {
> 创建房间控制器选项
***
<span id="struct_RoomController"></span>
### RoomController `STRUCT`
对房间进行操作的控制器,由 RoomManager 接管后返回
```go
Expand All @@ -68,6 +69,7 @@ type RoomController[EntityID comparable, RoomID comparable, Entity generic.IdR[E
owner *EntityID
}
```
<span id="struct_RoomManager"></span>
### RoomManager `STRUCT`
房间管理器是用于对房间进行管理的基本单元,通过该实例可以对房间进行增删改查等操作
- 该实例是线程安全的
Expand All @@ -78,11 +80,13 @@ type RoomManager[EntityID comparable, RoomID comparable, Entity generic.IdR[Enti
rooms map[RoomID]*RoomController[EntityID, RoomID, Entity, Room]
}
```
<span id="struct_RoomAssumeControlEventHandle"></span>
### RoomAssumeControlEventHandle `STRUCT`

```go
type RoomAssumeControlEventHandle[EntityID comparable, RoomID comparable, Entity generic.IdR[EntityID], Room generic.IdR[RoomID]] func(controller *RoomController[EntityID, RoomID, Entity, Room])
```
<span id="struct_RoomControllerOptions"></span>
### RoomControllerOptions `STRUCT`

```go
Expand Down
15 changes: 10 additions & 5 deletions game/task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Condition](#condition)|任务条件
|`STRUCT`|[RefreshTaskCounterEventHandler](#refreshtaskcountereventhandler)|暂无描述...
|`STRUCT`|[Option](#option)|任务选项
|`STRUCT`|[Status](#status)|暂无描述...
|`STRUCT`|[Task](#task)|是对任务信息进行描述和处理的结构体
|`STRUCT`|[Condition](#struct_Condition)|任务条件
|`STRUCT`|[RefreshTaskCounterEventHandler](#struct_RefreshTaskCounterEventHandler)|暂无描述...
|`STRUCT`|[Option](#struct_Option)|任务选项
|`STRUCT`|[Status](#struct_Status)|暂无描述...
|`STRUCT`|[Task](#struct_Task)|是对任务信息进行描述和处理的结构体

</details>

Expand Down Expand Up @@ -150,6 +150,7 @@ func TestCond(t *testing.T) {
> 生成任务
***
<span id="struct_Condition"></span>
### Condition `STRUCT`
任务条件
```go
Expand Down Expand Up @@ -221,23 +222,27 @@ type Condition map[any]any
#### func (Condition) GetAny(key any) any
> 获取特定类型的任务条件值,该值必须与预期类型一致,否则返回零值
***
<span id="struct_RefreshTaskCounterEventHandler"></span>
### RefreshTaskCounterEventHandler `STRUCT`

```go
type RefreshTaskCounterEventHandler[Trigger any] func(taskType string, trigger Trigger, count int64)
```
<span id="struct_Option"></span>
### Option `STRUCT`
任务选项
```go
type Option func(task *Task)
```
<span id="struct_Status"></span>
### Status `STRUCT`

```go
type Status byte
```
#### func (Status) String() string
***
<span id="struct_Task"></span>
### Task `STRUCT`
是对任务信息进行描述和处理的结构体
```go
Expand Down
9 changes: 6 additions & 3 deletions notify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ notify 包含了对外部第三方通知的实现,如机器人消息等
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[Manager](#manager)|通知管理器,可用于将通知同时发送至多个渠道
|`INTERFACE`|[Notify](#notify)|通用通知接口定义
|`INTERFACE`|[Sender](#sender)|通知发送器接口声明
|`STRUCT`|[Manager](#struct_Manager)|通知管理器,可用于将通知同时发送至多个渠道
|`INTERFACE`|[Notify](#struct_Notify)|通用通知接口定义
|`INTERFACE`|[Sender](#struct_Sender)|通知发送器接口声明

</details>

Expand All @@ -37,6 +37,7 @@ notify 包含了对外部第三方通知的实现,如机器人消息等
> 通过指定的 Sender 创建一个通知管理器, senders 包中提供了一些内置的 Sender
***
<span id="struct_Manager"></span>
### Manager `STRUCT`
通知管理器,可用于将通知同时发送至多个渠道
```go
Expand All @@ -52,13 +53,15 @@ type Manager struct {
#### func (*Manager) Release()
> 释放通知管理器
***
<span id="struct_Notify"></span>
### Notify `INTERFACE`
通用通知接口定义
```go
type Notify interface {
Format() (string, error)
}
```
<span id="struct_Sender"></span>
### Sender `INTERFACE`
通知发送器接口声明
```go
Expand Down
12 changes: 8 additions & 4 deletions notify/notifies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ notifies 包含了内置通知内容的实现
|类型|名称|描述
|:--|:--|:--
|`STRUCT`|[FeiShu](#feishu)|飞书通知消息
|`STRUCT`|[FeiShuMessage](#feishumessage)|暂无描述...
|`STRUCT`|[FeiShuRichText](#feishurichtext)|飞书富文本结构
|`STRUCT`|[FeiShuRichTextContent](#feishurichtextcontent)|飞书富文本内容体
|`STRUCT`|[FeiShu](#struct_FeiShu)|飞书通知消息
|`STRUCT`|[FeiShuMessage](#struct_FeiShuMessage)|暂无描述...
|`STRUCT`|[FeiShuRichText](#struct_FeiShuRichText)|飞书富文本结构
|`STRUCT`|[FeiShuRichTextContent](#struct_FeiShuRichTextContent)|飞书富文本内容体

</details>

Expand Down Expand Up @@ -147,6 +147,7 @@ notifies 包含了内置通知内容的实现
> 创建一个飞书富文本
***
<span id="struct_FeiShu"></span>
### FeiShu `STRUCT`
飞书通知消息
```go
Expand All @@ -158,11 +159,13 @@ type FeiShu struct {
#### func (*FeiShu) Format() ( string, error)
> 格式化通知内容
***
<span id="struct_FeiShuMessage"></span>
### FeiShuMessage `STRUCT`

```go
type FeiShuMessage func(feishu *FeiShu)
```
<span id="struct_FeiShuRichText"></span>
### FeiShuRichText `STRUCT`
飞书富文本结构
```go
Expand All @@ -173,6 +176,7 @@ type FeiShuRichText struct {
#### func (*FeiShuRichText) Create(lang string, title string) *FeiShuRichTextContent
> 创建一个特定语言和标题的富文本内容
***
<span id="struct_FeiShuRichTextContent"></span>
### FeiShuRichTextContent `STRUCT`
飞书富文本内容体
```go
Expand Down

0 comments on commit e7e679e

Please sign in to comment.