From e7e679ea8662d84aa9014dd26e643cc57d3374d7 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 15 Jan 2024 10:41:10 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=20README.md=20?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E4=B8=AD=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BD=93=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configuration/README.md | 6 +- game/activity/README.md | 33 ++++-- .../activity/internal/example/types/README.md | 3 +- game/fight/README.md | 15 ++- game/space/README.md | 12 +- game/task/README.md | 15 ++- notify/README.md | 9 +- notify/notifies/README.md | 12 +- notify/senders/README.md | 3 +- planner/pce/README.md | 111 ++++++++++++------ planner/pce/cs/README.md | 6 +- planner/pce/tmpls/README.md | 6 +- server/README.md | 60 ++++++---- server/client/README.md | 21 ++-- server/gateway/README.md | 21 ++-- server/internal/dispatcher/README.md | 18 ++- server/internal/logger/README.md | 6 +- server/lockstep/README.md | 12 +- server/router/README.md | 9 +- server/writeloop/README.md | 9 +- utils/aoi/README.md | 9 +- utils/arrangement/README.md | 30 +++-- utils/buffer/README.md | 9 +- utils/collection/README.md | 6 +- utils/collection/listings/README.md | 12 +- utils/collection/mappings/README.md | 3 +- utils/combination/README.md | 21 ++-- utils/deck/README.md | 9 +- utils/fsm/README.md | 6 +- utils/generator/astgo/README.md | 21 ++-- utils/generator/genreadme/README.md | 3 +- utils/generator/genreadme/builder.go | 3 +- utils/generic/README.md | 45 ++++--- utils/geometry/README.md | 27 +++-- utils/geometry/astar/README.md | 3 +- utils/geometry/dp/README.md | 6 +- utils/geometry/matrix/README.md | 3 +- utils/geometry/navmesh/README.md | 3 +- utils/hub/README.md | 3 +- utils/huge/README.md | 6 +- utils/leaderboard/README.md | 9 +- utils/log/README.md | 12 +- utils/log/survey/README.md | 21 ++-- utils/maths/README.md | 3 +- utils/memory/README.md | 3 +- utils/moving/README.md | 12 +- utils/offset/README.md | 3 +- utils/sole/README.md | 3 +- utils/super/README.md | 18 ++- utils/timer/README.md | 15 ++- utils/times/README.md | 6 +- 51 files changed, 480 insertions(+), 240 deletions(-) diff --git a/configuration/README.md b/configuration/README.md index d3c23cc..a913c41 100644 --- a/configuration/README.md +++ b/configuration/README.md @@ -29,8 +29,8 @@ configuration 基于配置导表功能实现的配置加载及刷新功能 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[RefreshEventHandle](#refresheventhandle)|配置刷新事件处理函数 -|`INTERFACE`|[Loader](#loader)|配置加载器 +|`STRUCT`|[RefreshEventHandle](#struct_RefreshEventHandle)|配置刷新事件处理函数 +|`INTERFACE`|[Loader](#struct_Loader)|配置加载器 @@ -75,11 +75,13 @@ configuration 基于配置导表功能实现的配置加载及刷新功能 *** + ### RefreshEventHandle `STRUCT` 配置刷新事件处理函数 ```go type RefreshEventHandle func() ``` + ### Loader `INTERFACE` 配置加载器 ```go diff --git a/game/activity/README.md b/game/activity/README.md index 77dd01e..85c9360 100644 --- a/game/activity/README.md +++ b/game/activity/README.md @@ -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)|活动选项 @@ -166,6 +166,7 @@ activity 活动状态管理 > 创建活动选项 *** + ### Activity `STRUCT` 活动描述 ```go @@ -185,6 +186,7 @@ type Activity[Type generic.Basic, ID generic.Basic] struct { initializeData func() } ``` + ### Controller `STRUCT` 活动控制器 ```go @@ -199,6 +201,7 @@ type Controller[Type generic.Basic, ID generic.Basic, Data any, EntityID generic mutex sync.RWMutex } ``` + ### BasicActivityController `INTERFACE` ```go @@ -209,6 +212,7 @@ type BasicActivityController[Type generic.Basic, ID generic.Basic, Data any, Ent Refresh(activityId ID) } ``` + ### NoneDataActivityController `INTERFACE` 无数据活动控制器 ```go @@ -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] } ``` + ### GlobalDataActivityController `INTERFACE` 全局数据活动控制器 ```go @@ -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] } ``` + ### EntityDataActivityController `INTERFACE` 实体数据活动控制器 ```go @@ -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] } ``` + ### GlobalAndEntityDataActivityController `INTERFACE` 全局数据和实体数据活动控制器 ```go @@ -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] } ``` + ### DataMeta `STRUCT` 全局活动数据 ```go @@ -254,6 +262,7 @@ type DataMeta[Data any] struct { LastNewDay time.Time } ``` + ### EntityDataMeta `STRUCT` 活动实体数据 ```go @@ -263,11 +272,13 @@ type EntityDataMeta[Data any] struct { LastNewDay time.Time } ``` + ### UpcomingEventHandler `STRUCT` ```go type UpcomingEventHandler[ID generic.Basic] func(activityId ID) ``` + ### Options `STRUCT` 活动选项 ```go diff --git a/game/activity/internal/example/types/README.md b/game/activity/internal/example/types/README.md index a7d0d51..28267bf 100644 --- a/game/activity/internal/example/types/README.md +++ b/game/activity/internal/example/types/README.md @@ -16,13 +16,14 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[DemoActivityData](#demoactivitydata)|暂无描述... +|`STRUCT`|[DemoActivityData](#struct_DemoActivityData)|暂无描述... *** ## 详情信息 + ### DemoActivityData `STRUCT` ```go diff --git a/game/fight/README.md b/game/fight/README.md index 144feeb..8f4bb3e 100644 --- a/game/fight/README.md +++ b/game/fight/README.md @@ -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)|暂无描述... @@ -40,6 +40,7 @@ > - calcNextTurnDuration 将返回下一次行动时间间隔,适用于按照速度计算下一次行动时间间隔的情况。当返回 0 时,将使用默认的行动超时时间 *** + ### TurnBased `STRUCT` 回合制 ```go @@ -64,6 +65,7 @@ type TurnBased[CampID comparable, EntityID comparable, Camp generic.IdR[CampID], closed bool } ``` + ### TurnBasedControllerInfo `INTERFACE` ```go @@ -77,6 +79,7 @@ type TurnBasedControllerInfo[CampID comparable, EntityID comparable, Camp generi Stop() } ``` + ### TurnBasedControllerAction `INTERFACE` ```go @@ -86,6 +89,7 @@ type TurnBasedControllerAction[CampID comparable, EntityID comparable, Camp gene Refresh(duration time.Duration) time.Time } ``` + ### TurnBasedController `STRUCT` 回合制控制器 ```go @@ -93,6 +97,7 @@ type TurnBasedController[CampID comparable, EntityID comparable, Camp generic.Id tb *TurnBased[CampID, EntityID, Camp, Entity] } ``` + ### TurnBasedEntitySwitchEventHandler `STRUCT` ```go diff --git a/game/space/README.md b/game/space/README.md index 55dc53c..1e3542f 100644 --- a/game/space/README.md +++ b/game/space/README.md @@ -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)|暂无描述... @@ -54,6 +54,7 @@ func ExampleNewRoomManager() { > 创建房间控制器选项 *** + ### RoomController `STRUCT` 对房间进行操作的控制器,由 RoomManager 接管后返回 ```go @@ -68,6 +69,7 @@ type RoomController[EntityID comparable, RoomID comparable, Entity generic.IdR[E owner *EntityID } ``` + ### RoomManager `STRUCT` 房间管理器是用于对房间进行管理的基本单元,通过该实例可以对房间进行增删改查等操作 - 该实例是线程安全的 @@ -78,11 +80,13 @@ type RoomManager[EntityID comparable, RoomID comparable, Entity generic.IdR[Enti rooms map[RoomID]*RoomController[EntityID, RoomID, Entity, Room] } ``` + ### RoomAssumeControlEventHandle `STRUCT` ```go type RoomAssumeControlEventHandle[EntityID comparable, RoomID comparable, Entity generic.IdR[EntityID], Room generic.IdR[RoomID]] func(controller *RoomController[EntityID, RoomID, Entity, Room]) ``` + ### RoomControllerOptions `STRUCT` ```go diff --git a/game/task/README.md b/game/task/README.md index 9c116b9..a86db7e 100644 --- a/game/task/README.md +++ b/game/task/README.md @@ -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)|是对任务信息进行描述和处理的结构体 @@ -150,6 +150,7 @@ func TestCond(t *testing.T) { > 生成任务 *** + ### Condition `STRUCT` 任务条件 ```go @@ -221,16 +222,19 @@ type Condition map[any]any #### func (Condition) GetAny(key any) any > 获取特定类型的任务条件值,该值必须与预期类型一致,否则返回零值 *** + ### RefreshTaskCounterEventHandler `STRUCT` ```go type RefreshTaskCounterEventHandler[Trigger any] func(taskType string, trigger Trigger, count int64) ``` + ### Option `STRUCT` 任务选项 ```go type Option func(task *Task) ``` + ### Status `STRUCT` ```go @@ -238,6 +242,7 @@ type Status byte ``` #### func (Status) String() string *** + ### Task `STRUCT` 是对任务信息进行描述和处理的结构体 ```go diff --git a/notify/README.md b/notify/README.md index 4d1c98e..ea293bb 100644 --- a/notify/README.md +++ b/notify/README.md @@ -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)|通知发送器接口声明 @@ -37,6 +37,7 @@ notify 包含了对外部第三方通知的实现,如机器人消息等 > 通过指定的 Sender 创建一个通知管理器, senders 包中提供了一些内置的 Sender *** + ### Manager `STRUCT` 通知管理器,可用于将通知同时发送至多个渠道 ```go @@ -52,6 +53,7 @@ type Manager struct { #### func (*Manager) Release() > 释放通知管理器 *** + ### Notify `INTERFACE` 通用通知接口定义 ```go @@ -59,6 +61,7 @@ type Notify interface { Format() (string, error) } ``` + ### Sender `INTERFACE` 通知发送器接口声明 ```go diff --git a/notify/notifies/README.md b/notify/notifies/README.md index 21dfa21..17c6322 100644 --- a/notify/notifies/README.md +++ b/notify/notifies/README.md @@ -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)|飞书富文本内容体 @@ -147,6 +147,7 @@ notifies 包含了内置通知内容的实现 > 创建一个飞书富文本 *** + ### FeiShu `STRUCT` 飞书通知消息 ```go @@ -158,11 +159,13 @@ type FeiShu struct { #### func (*FeiShu) Format() ( string, error) > 格式化通知内容 *** + ### FeiShuMessage `STRUCT` ```go type FeiShuMessage func(feishu *FeiShu) ``` + ### FeiShuRichText `STRUCT` 飞书富文本结构 ```go @@ -173,6 +176,7 @@ type FeiShuRichText struct { #### func (*FeiShuRichText) Create(lang string, title string) *FeiShuRichTextContent > 创建一个特定语言和标题的富文本内容 *** + ### FeiShuRichTextContent `STRUCT` 飞书富文本内容体 ```go diff --git a/notify/senders/README.md b/notify/senders/README.md index 5038d8b..593f597 100644 --- a/notify/senders/README.md +++ b/notify/senders/README.md @@ -23,7 +23,7 @@ senders Package 包含了内置通知发送器的实现 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[FeiShu](#feishu)|飞书发送器 +|`STRUCT`|[FeiShu](#struct_FeiShu)|飞书发送器 @@ -35,6 +35,7 @@ senders Package 包含了内置通知发送器的实现 > 根据特定的 webhook 地址创建飞书发送器 *** + ### FeiShu `STRUCT` 飞书发送器 ```go diff --git a/planner/pce/README.md b/planner/pce/README.md index 2d07abb..485242c 100644 --- a/planner/pce/README.md +++ b/planner/pce/README.md @@ -26,43 +26,43 @@ |类型|名称|描述 |:--|:--|:-- -|`INTERFACE`|[Config](#config)|配置解析接口 -|`INTERFACE`|[DataTmpl](#datatmpl)|数据导出模板 -|`STRUCT`|[Exporter](#exporter)|导出器 -|`INTERFACE`|[Field](#field)|基本字段类型接口 -|`STRUCT`|[Int](#int)|暂无描述... -|`STRUCT`|[Int8](#int8)|暂无描述... -|`STRUCT`|[Int16](#int16)|暂无描述... -|`STRUCT`|[Int32](#int32)|暂无描述... -|`STRUCT`|[Int64](#int64)|暂无描述... -|`STRUCT`|[Uint](#uint)|暂无描述... -|`STRUCT`|[Uint8](#uint8)|暂无描述... -|`STRUCT`|[Uint16](#uint16)|暂无描述... -|`STRUCT`|[Uint32](#uint32)|暂无描述... -|`STRUCT`|[Uint64](#uint64)|暂无描述... -|`STRUCT`|[Float32](#float32)|暂无描述... -|`STRUCT`|[Float64](#float64)|暂无描述... -|`STRUCT`|[String](#string)|暂无描述... -|`STRUCT`|[Bool](#bool)|暂无描述... -|`STRUCT`|[Byte](#byte)|暂无描述... -|`STRUCT`|[Rune](#rune)|暂无描述... -|`STRUCT`|[Complex64](#complex64)|暂无描述... -|`STRUCT`|[Complex128](#complex128)|暂无描述... -|`STRUCT`|[Uintptr](#uintptr)|暂无描述... -|`STRUCT`|[Double](#double)|暂无描述... -|`STRUCT`|[Float](#float)|暂无描述... -|`STRUCT`|[Long](#long)|暂无描述... -|`STRUCT`|[Short](#short)|暂无描述... -|`STRUCT`|[Char](#char)|暂无描述... -|`STRUCT`|[Number](#number)|暂无描述... -|`STRUCT`|[Integer](#integer)|暂无描述... -|`STRUCT`|[Boolean](#boolean)|暂无描述... -|`STRUCT`|[Loader](#loader)|配置加载器 -|`STRUCT`|[DataInfo](#datainfo)|配置数据 -|`STRUCT`|[DataField](#datafield)|配置数据字段 -|`INTERFACE`|[Tmpl](#tmpl)|配置结构模板接口 -|`STRUCT`|[TmplField](#tmplfield)|模板字段 -|`STRUCT`|[TmplStruct](#tmplstruct)|模板结构 +|`INTERFACE`|[Config](#struct_Config)|配置解析接口 +|`INTERFACE`|[DataTmpl](#struct_DataTmpl)|数据导出模板 +|`STRUCT`|[Exporter](#struct_Exporter)|导出器 +|`INTERFACE`|[Field](#struct_Field)|基本字段类型接口 +|`STRUCT`|[Int](#struct_Int)|暂无描述... +|`STRUCT`|[Int8](#struct_Int8)|暂无描述... +|`STRUCT`|[Int16](#struct_Int16)|暂无描述... +|`STRUCT`|[Int32](#struct_Int32)|暂无描述... +|`STRUCT`|[Int64](#struct_Int64)|暂无描述... +|`STRUCT`|[Uint](#struct_Uint)|暂无描述... +|`STRUCT`|[Uint8](#struct_Uint8)|暂无描述... +|`STRUCT`|[Uint16](#struct_Uint16)|暂无描述... +|`STRUCT`|[Uint32](#struct_Uint32)|暂无描述... +|`STRUCT`|[Uint64](#struct_Uint64)|暂无描述... +|`STRUCT`|[Float32](#struct_Float32)|暂无描述... +|`STRUCT`|[Float64](#struct_Float64)|暂无描述... +|`STRUCT`|[String](#struct_String)|暂无描述... +|`STRUCT`|[Bool](#struct_Bool)|暂无描述... +|`STRUCT`|[Byte](#struct_Byte)|暂无描述... +|`STRUCT`|[Rune](#struct_Rune)|暂无描述... +|`STRUCT`|[Complex64](#struct_Complex64)|暂无描述... +|`STRUCT`|[Complex128](#struct_Complex128)|暂无描述... +|`STRUCT`|[Uintptr](#struct_Uintptr)|暂无描述... +|`STRUCT`|[Double](#struct_Double)|暂无描述... +|`STRUCT`|[Float](#struct_Float)|暂无描述... +|`STRUCT`|[Long](#struct_Long)|暂无描述... +|`STRUCT`|[Short](#struct_Short)|暂无描述... +|`STRUCT`|[Char](#struct_Char)|暂无描述... +|`STRUCT`|[Number](#struct_Number)|暂无描述... +|`STRUCT`|[Integer](#struct_Integer)|暂无描述... +|`STRUCT`|[Boolean](#struct_Boolean)|暂无描述... +|`STRUCT`|[Loader](#struct_Loader)|配置加载器 +|`STRUCT`|[DataInfo](#struct_DataInfo)|配置数据 +|`STRUCT`|[DataField](#struct_DataField)|配置数据字段 +|`INTERFACE`|[Tmpl](#struct_Tmpl)|配置结构模板接口 +|`STRUCT`|[TmplField](#struct_TmplField)|模板字段 +|`STRUCT`|[TmplStruct](#struct_TmplStruct)|模板结构 @@ -106,6 +106,7 @@ func TestGetFieldGolangType(t *testing.T) { > - 加载器被用于加载配置表的数据和结构信息 *** + ### Config `INTERFACE` 配置解析接口 - 用于将配置文件解析为可供分析的数据结构 @@ -120,6 +121,7 @@ type Config interface { GetData() [][]DataInfo } ``` + ### DataTmpl `INTERFACE` 数据导出模板 ```go @@ -127,6 +129,7 @@ type DataTmpl interface { Render(data map[any]any) (string, error) } ``` + ### Exporter `STRUCT` 导出器 ```go @@ -138,6 +141,7 @@ type Exporter struct{} #### func (*Exporter) ExportData(tmpl DataTmpl, data map[any]any) ( []byte, error) > 导出数据 *** + ### Field `INTERFACE` 基本字段类型接口 ```go @@ -147,6 +151,7 @@ type Field interface { Parse(value string) any } ``` + ### Int `STRUCT` ```go @@ -158,6 +163,7 @@ type Int int *** #### func (Int) Parse(value string) any *** + ### Int8 `STRUCT` ```go @@ -169,6 +175,7 @@ type Int8 int8 *** #### func (Int8) Parse(value string) any *** + ### Int16 `STRUCT` ```go @@ -180,6 +187,7 @@ type Int16 int16 *** #### func (Int16) Parse(value string) any *** + ### Int32 `STRUCT` ```go @@ -191,6 +199,7 @@ type Int32 int32 *** #### func (Int32) Parse(value string) any *** + ### Int64 `STRUCT` ```go @@ -202,6 +211,7 @@ type Int64 int64 *** #### func (Int64) Parse(value string) any *** + ### Uint `STRUCT` ```go @@ -213,6 +223,7 @@ type Uint uint *** #### func (Uint) Parse(value string) any *** + ### Uint8 `STRUCT` ```go @@ -224,6 +235,7 @@ type Uint8 uint8 *** #### func (Uint8) Parse(value string) any *** + ### Uint16 `STRUCT` ```go @@ -235,6 +247,7 @@ type Uint16 uint16 *** #### func (Uint16) Parse(value string) any *** + ### Uint32 `STRUCT` ```go @@ -246,6 +259,7 @@ type Uint32 uint32 *** #### func (Uint32) Parse(value string) any *** + ### Uint64 `STRUCT` ```go @@ -257,6 +271,7 @@ type Uint64 uint64 *** #### func (Uint64) Parse(value string) any *** + ### Float32 `STRUCT` ```go @@ -268,6 +283,7 @@ type Float32 float32 *** #### func (Float32) Parse(value string) any *** + ### Float64 `STRUCT` ```go @@ -279,6 +295,7 @@ type Float64 float64 *** #### func (Float64) Parse(value string) any *** + ### String `STRUCT` ```go @@ -290,6 +307,7 @@ type String string *** #### func (String) Parse(value string) any *** + ### Bool `STRUCT` ```go @@ -301,6 +319,7 @@ type Bool bool *** #### func (Bool) Parse(value string) any *** + ### Byte `STRUCT` ```go @@ -312,6 +331,7 @@ type Byte byte *** #### func (Byte) Parse(value string) any *** + ### Rune `STRUCT` ```go @@ -323,6 +343,7 @@ type Rune rune *** #### func (Rune) Parse(value string) any *** + ### Complex64 `STRUCT` ```go @@ -334,6 +355,7 @@ type Complex64 complex64 *** #### func (Complex64) Parse(value string) any *** + ### Complex128 `STRUCT` ```go @@ -345,6 +367,7 @@ type Complex128 complex128 *** #### func (Complex128) Parse(value string) any *** + ### Uintptr `STRUCT` ```go @@ -356,6 +379,7 @@ type Uintptr uintptr *** #### func (Uintptr) Parse(value string) any *** + ### Double `STRUCT` ```go @@ -367,6 +391,7 @@ type Double float64 *** #### func (Double) Parse(value string) any *** + ### Float `STRUCT` ```go @@ -378,6 +403,7 @@ type Float float32 *** #### func (Float) Parse(value string) any *** + ### Long `STRUCT` ```go @@ -389,6 +415,7 @@ type Long int64 *** #### func (Long) Parse(value string) any *** + ### Short `STRUCT` ```go @@ -400,6 +427,7 @@ type Short int16 *** #### func (Short) Parse(value string) any *** + ### Char `STRUCT` ```go @@ -411,6 +439,7 @@ type Char int8 *** #### func (Char) Parse(value string) any *** + ### Number `STRUCT` ```go @@ -422,6 +451,7 @@ type Number float64 *** #### func (Number) Parse(value string) any *** + ### Integer `STRUCT` ```go @@ -433,6 +463,7 @@ type Integer int64 *** #### func (Integer) Parse(value string) any *** + ### Boolean `STRUCT` ```go @@ -444,6 +475,7 @@ type Boolean bool *** #### func (Boolean) Parse(value string) any *** + ### Loader `STRUCT` 配置加载器 ```go @@ -457,6 +489,7 @@ type Loader struct { #### func (*Loader) LoadData(config Config) map[any]any > 加载配置并得到配置数据 *** + ### DataInfo `STRUCT` 配置数据 ```go @@ -465,6 +498,7 @@ type DataInfo struct { Value string } ``` + ### DataField `STRUCT` 配置数据字段 ```go @@ -476,6 +510,7 @@ type DataField struct { ExportType string } ``` + ### Tmpl `INTERFACE` 配置结构模板接口 ```go @@ -483,6 +518,7 @@ type Tmpl interface { Render(templates ...*TmplStruct) (string, error) } ``` + ### TmplField `STRUCT` 模板字段 ```go @@ -505,6 +541,7 @@ type TmplField struct { #### func (*TmplField) IsSlice() bool > 是否是切片类型 *** + ### TmplStruct `STRUCT` 模板结构 ```go diff --git a/planner/pce/cs/README.md b/planner/pce/cs/README.md index 85c2332..4c9d347 100644 --- a/planner/pce/cs/README.md +++ b/planner/pce/cs/README.md @@ -23,8 +23,8 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[XlsxExportType](#xlsxexporttype)|暂无描述... -|`STRUCT`|[Xlsx](#xlsx)|内置的 Xlsx 配置 +|`STRUCT`|[XlsxExportType](#struct_XlsxExportType)|暂无描述... +|`STRUCT`|[Xlsx](#struct_Xlsx)|内置的 Xlsx 配置 @@ -35,11 +35,13 @@ *** + ### XlsxExportType `STRUCT` ```go type XlsxExportType int ``` + ### Xlsx `STRUCT` 内置的 Xlsx 配置 ```go diff --git a/planner/pce/tmpls/README.md b/planner/pce/tmpls/README.md index dab5451..ac56c86 100644 --- a/planner/pce/tmpls/README.md +++ b/planner/pce/tmpls/README.md @@ -24,8 +24,8 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Golang](#golang)|配置导出模板 -|`STRUCT`|[JSON](#json)|暂无描述... +|`STRUCT`|[Golang](#struct_Golang)|配置导出模板 +|`STRUCT`|[JSON](#struct_JSON)|暂无描述... @@ -41,6 +41,7 @@ *** + ### Golang `STRUCT` 配置导出模板 ```go @@ -57,6 +58,7 @@ type Golang struct { *** #### func (*Golang) HasIndex(config *pce.TmplStruct) bool *** + ### JSON `STRUCT` ```go diff --git a/server/README.md b/server/README.md index 02ca621..d048f66 100644 --- a/server/README.md +++ b/server/README.md @@ -54,26 +54,26 @@ server 提供了包含多种网络类型的服务器实现 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Bot](#bot)|暂无描述... -|`STRUCT`|[BotOption](#botoption)|暂无描述... -|`STRUCT`|[Conn](#conn)|服务器连接单次消息的包装 -|`STRUCT`|[ConsoleParams](#consoleparams)|控制台参数 -|`STRUCT`|[MessageReadyEventHandler](#messagereadyeventhandler)|暂无描述... -|`STRUCT`|[Http](#http)|基于 gin.Engine 包装的 http 服务器 -|`STRUCT`|[HttpContext](#httpcontext)|基于 gin.Context 的 http 请求上下文 -|`STRUCT`|[HandlerFunc](#handlerfunc)|暂无描述... -|`STRUCT`|[ContextPacker](#contextpacker)|暂无描述... -|`STRUCT`|[HttpRouter](#httprouter)|暂无描述... -|`STRUCT`|[HttpWrapperHandleFunc](#httpwrapperhandlefunc)|暂无描述... -|`STRUCT`|[HttpWrapper](#httpwrapper)|http 包装器 -|`STRUCT`|[HttpWrapperGroup](#httpwrappergroup)|http 包装器 -|`STRUCT`|[MessageType](#messagetype)|暂无描述... -|`STRUCT`|[Message](#message)|服务器消息 -|`STRUCT`|[MultipleServer](#multipleserver)|暂无描述... -|`STRUCT`|[Network](#network)|暂无描述... -|`STRUCT`|[Option](#option)|暂无描述... -|`STRUCT`|[Server](#server)|网络服务器 -|`INTERFACE`|[Service](#service)|兼容传统 service 设计模式的接口 +|`STRUCT`|[Bot](#struct_Bot)|暂无描述... +|`STRUCT`|[BotOption](#struct_BotOption)|暂无描述... +|`STRUCT`|[Conn](#struct_Conn)|服务器连接单次消息的包装 +|`STRUCT`|[ConsoleParams](#struct_ConsoleParams)|控制台参数 +|`STRUCT`|[MessageReadyEventHandler](#struct_MessageReadyEventHandler)|暂无描述... +|`STRUCT`|[Http](#struct_Http)|基于 gin.Engine 包装的 http 服务器 +|`STRUCT`|[HttpContext](#struct_HttpContext)|基于 gin.Context 的 http 请求上下文 +|`STRUCT`|[HandlerFunc](#struct_HandlerFunc)|暂无描述... +|`STRUCT`|[ContextPacker](#struct_ContextPacker)|暂无描述... +|`STRUCT`|[HttpRouter](#struct_HttpRouter)|暂无描述... +|`STRUCT`|[HttpWrapperHandleFunc](#struct_HttpWrapperHandleFunc)|暂无描述... +|`STRUCT`|[HttpWrapper](#struct_HttpWrapper)|http 包装器 +|`STRUCT`|[HttpWrapperGroup](#struct_HttpWrapperGroup)|http 包装器 +|`STRUCT`|[MessageType](#struct_MessageType)|暂无描述... +|`STRUCT`|[Message](#struct_Message)|服务器消息 +|`STRUCT`|[MultipleServer](#struct_MultipleServer)|暂无描述... +|`STRUCT`|[Network](#struct_Network)|暂无描述... +|`STRUCT`|[Option](#struct_Option)|暂无描述... +|`STRUCT`|[Server](#struct_Server)|网络服务器 +|`INTERFACE`|[Service](#struct_Service)|兼容传统 service 设计模式的接口 @@ -385,6 +385,7 @@ func TestBindService(t *testing.T) { *** + ### Bot `STRUCT` ```go @@ -413,11 +414,13 @@ type Bot struct { #### func (*Bot) SendWSPacket(wst int, packet []byte) > 发送 WebSocket 数据包到服务器 *** + ### BotOption `STRUCT` ```go type BotOption func(bot *Bot) ``` + ### Conn `STRUCT` 服务器连接单次消息的包装 ```go @@ -501,6 +504,7 @@ type Conn struct { #### func (*Conn) Close(err ...error) > 关闭连接 *** + ### ConsoleParams `STRUCT` 控制台参数 ```go @@ -527,11 +531,13 @@ type ConsoleParams map[string][]string #### func (ConsoleParams) Clear() > 清空参数 *** + ### MessageReadyEventHandler `STRUCT` ```go type MessageReadyEventHandler func(srv *Server) ``` + ### Http `STRUCT` 基于 gin.Engine 包装的 http 服务器 ```go @@ -543,6 +549,7 @@ type Http[Context any] struct { ``` #### func (*Http) Gin() *gin.Engine *** + ### HttpContext `STRUCT` 基于 gin.Context 的 http 请求上下文 ```go @@ -556,16 +563,19 @@ type HttpContext struct { #### func (*HttpContext) ReadTo(dest any) error > 读取请求数据到指定结构体,如果失败则返回错误 *** + ### HandlerFunc `STRUCT` ```go type HandlerFunc[Context any] func(ctx Context) ``` + ### ContextPacker `STRUCT` ```go type ContextPacker[Context any] func(ctx *gin.Context) Context ``` + ### HttpRouter `STRUCT` ```go @@ -639,11 +649,13 @@ type HttpRouter[Context any] struct { #### func (*HttpRouter) Use(middleware ...HandlerFunc[Context]) *HttpRouter[Context] > 将中间件附加到路由组。 *** + ### HttpWrapperHandleFunc `STRUCT` ```go type HttpWrapperHandleFunc[CTX any] func(ctx CTX) ``` + ### HttpWrapper `STRUCT` http 包装器 ```go @@ -703,6 +715,7 @@ type HttpWrapper[CTX any] struct { #### func (*HttpWrapper) Group(relativePath string, handlers ...HttpWrapperHandleFunc[CTX]) *HttpWrapperGroup[CTX] > 创建一个新的路由组。您应该添加所有具有共同中间件的路由。 *** + ### HttpWrapperGroup `STRUCT` http 包装器 ```go @@ -738,6 +751,7 @@ type HttpWrapperGroup[CTX any] struct { #### func (*HttpWrapperGroup) Group(relativePath string, handlers ...HttpWrapperHandleFunc[CTX]) *HttpWrapperGroup[CTX] > 创建分组 *** + ### MessageType `STRUCT` ```go @@ -746,6 +760,7 @@ type MessageType byte #### func (MessageType) String() string > 返回消息类型的字符串表示 *** + ### Message `STRUCT` 服务器消息 ```go @@ -771,6 +786,7 @@ type Message struct { #### func (*Message) String() string > 返回消息的字符串表示 *** + ### MultipleServer `STRUCT` ```go @@ -787,6 +803,7 @@ type MultipleServer struct { *** #### func (*MultipleServer) OnExitEvent() *** + ### Network `STRUCT` ```go @@ -795,11 +812,13 @@ type Network string #### func (Network) IsSocket() bool > 返回当前服务器的网络模式是否为 Socket 模式 *** + ### Option `STRUCT` ```go type Option func(srv *Server) ``` + ### Server `STRUCT` 网络服务器 ```go @@ -966,6 +985,7 @@ func ExampleServer_Run() { #### func (*Server) HasMessageStatistics() bool > 是否了开启消息统计 *** + ### Service `INTERFACE` 兼容传统 service 设计模式的接口 ```go diff --git a/server/client/README.md b/server/client/README.md index ee5bc4c..1d7658e 100644 --- a/server/client/README.md +++ b/server/client/README.md @@ -27,13 +27,13 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Client](#client)|客户端 -|`INTERFACE`|[Core](#core)|暂无描述... -|`STRUCT`|[ConnectionClosedEventHandle](#connectionclosedeventhandle)|暂无描述... -|`STRUCT`|[Packet](#packet)|暂无描述... -|`STRUCT`|[TCP](#tcp)|暂无描述... -|`STRUCT`|[UnixDomainSocket](#unixdomainsocket)|暂无描述... -|`STRUCT`|[Websocket](#websocket)|websocket 客户端 +|`STRUCT`|[Client](#struct_Client)|客户端 +|`INTERFACE`|[Core](#struct_Core)|暂无描述... +|`STRUCT`|[ConnectionClosedEventHandle](#struct_ConnectionClosedEventHandle)|暂无描述... +|`STRUCT`|[Packet](#struct_Packet)|暂无描述... +|`STRUCT`|[TCP](#struct_TCP)|暂无描述... +|`STRUCT`|[UnixDomainSocket](#struct_UnixDomainSocket)|暂无描述... +|`STRUCT`|[Websocket](#struct_Websocket)|websocket 客户端 @@ -63,6 +63,7 @@ > 创建 websocket 客户端 *** + ### Client `STRUCT` 客户端 ```go @@ -138,6 +139,7 @@ func TestClient_WriteWS(t *testing.T) { #### func (*Client) GetServerAddr() string > 获取服务器地址 *** + ### Core `INTERFACE` ```go @@ -149,11 +151,13 @@ type Core interface { Clone() Core } ``` + ### ConnectionClosedEventHandle `STRUCT` ```go type ConnectionClosedEventHandle func(conn *Client, err any) ``` + ### Packet `STRUCT` ```go @@ -163,6 +167,7 @@ type Packet struct { callback func(err error) } ``` + ### TCP `STRUCT` ```go @@ -182,6 +187,7 @@ type TCP struct { *** #### func (*TCP) Clone() Core *** + ### UnixDomainSocket `STRUCT` ```go @@ -243,6 +249,7 @@ func TestUnixDomainSocket_Write(t *testing.T) { *** #### func (*UnixDomainSocket) Clone() Core *** + ### Websocket `STRUCT` websocket 客户端 ```go diff --git a/server/gateway/README.md b/server/gateway/README.md index 224b2ba..e647ee3 100644 --- a/server/gateway/README.md +++ b/server/gateway/README.md @@ -32,13 +32,13 @@ gateway 是用于处理服务器消息的网关模块,适用于对客户端消 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Endpoint](#endpoint)|网关端点 -|`STRUCT`|[EndpointOption](#endpointoption)|网关端点选项 -|`STRUCT`|[ConnectionOpenedEventHandle](#connectionopenedeventhandle)|暂无描述... -|`STRUCT`|[EndpointSelector](#endpointselector)|暂无描述... -|`STRUCT`|[Gateway](#gateway)|基于 server.Server 实现的网关服务器 -|`STRUCT`|[Option](#option)|网关选项 -|`INTERFACE`|[Scanner](#scanner)|端点扫描器 +|`STRUCT`|[Endpoint](#struct_Endpoint)|网关端点 +|`STRUCT`|[EndpointOption](#struct_EndpointOption)|网关端点选项 +|`STRUCT`|[ConnectionOpenedEventHandle](#struct_ConnectionOpenedEventHandle)|暂无描述... +|`STRUCT`|[EndpointSelector](#struct_EndpointSelector)|暂无描述... +|`STRUCT`|[Gateway](#struct_Gateway)|基于 server.Server 实现的网关服务器 +|`STRUCT`|[Option](#struct_Option)|网关选项 +|`INTERFACE`|[Scanner](#struct_Scanner)|端点扫描器 @@ -105,6 +105,7 @@ gateway 是用于处理服务器消息的网关模块,适用于对客户端消 > - | ipv4(4) | port(2) | cost(4) | packet | *** + ### Endpoint `STRUCT` 网关端点 - 每一个端点均表示了一个目标服务,网关会将数据包转发到该端点,由该端点负责将数据包转发到目标服务。 @@ -141,21 +142,25 @@ type Endpoint struct { > 转发数据包到该端点 > - 端点在处理数据包时,应区分数据包为普通直连数据包还是网关数据包。可通过 UnmarshalGatewayOutPacket 进行数据包解析,当解析失败且无其他数据包协议时,可认为该数据包为普通直连数据包。 *** + ### EndpointOption `STRUCT` 网关端点选项 ```go type EndpointOption func(endpoint *Endpoint) ``` + ### ConnectionOpenedEventHandle `STRUCT` ```go type ConnectionOpenedEventHandle func(gateway *Gateway, conn *server.Conn) ``` + ### EndpointSelector `STRUCT` ```go type EndpointSelector func(endpoints []*Endpoint) *Endpoint ``` + ### Gateway `STRUCT` 基于 server.Server 实现的网关服务器 - 网关服务器是一个特殊的服务器,它会通过扫描器扫描端点列表,然后连接到端点列表中的所有端点,当端点连接成功后,网关服务器会将客户端的连接数据转发到端点服务器 @@ -230,11 +235,13 @@ func TestGateway_Run(t *testing.T) { #### func (*Gateway) SwitchEndpoint(source *Endpoint, dest *Endpoint) > 将端点端点的所有连接切换到另一个端点 *** + ### Option `STRUCT` 网关选项 ```go type Option func(gateway *Gateway) ``` + ### Scanner `INTERFACE` 端点扫描器 ```go diff --git a/server/internal/dispatcher/README.md b/server/internal/dispatcher/README.md index 1d3bd6e..1c6e6a5 100644 --- a/server/internal/dispatcher/README.md +++ b/server/internal/dispatcher/README.md @@ -24,12 +24,12 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Action](#action)|消息分发器操作器,用于暴露外部可操作的消息分发器函数 -|`STRUCT`|[Handler](#handler)|消息处理器 -|`STRUCT`|[Dispatcher](#dispatcher)|用于服务器消息处理的消息分发器 -|`STRUCT`|[Manager](#manager)|消息分发器管理器 -|`INTERFACE`|[Message](#message)|暂无描述... -|`INTERFACE`|[Producer](#producer)|暂无描述... +|`STRUCT`|[Action](#struct_Action)|消息分发器操作器,用于暴露外部可操作的消息分发器函数 +|`STRUCT`|[Handler](#struct_Handler)|消息处理器 +|`STRUCT`|[Dispatcher](#struct_Dispatcher)|用于服务器消息处理的消息分发器 +|`STRUCT`|[Manager](#struct_Manager)|消息分发器管理器 +|`INTERFACE`|[Message](#struct_Message)|暂无描述... +|`INTERFACE`|[Producer](#struct_Producer)|暂无描述... @@ -165,6 +165,7 @@ func TestNewManager(t *testing.T) { *** + ### Action `STRUCT` 消息分发器操作器,用于暴露外部可操作的消息分发器函数 ```go @@ -173,11 +174,13 @@ type Action[P Producer, M Message[P]] struct { d *Dispatcher[P, M] } ``` + ### Handler `STRUCT` 消息处理器 ```go type Handler[P Producer, M Message[P]] func(dispatcher *Dispatcher[P, M], message M) ``` + ### Dispatcher `STRUCT` 用于服务器消息处理的消息分发器 @@ -207,6 +210,7 @@ type Dispatcher[P Producer, M Message[P]] struct { abort chan struct{} } ``` + ### Manager `STRUCT` 消息分发器管理器 ```go @@ -223,6 +227,7 @@ type Manager[P Producer, M Message[P]] struct { createdHandler func(name string) } ``` + ### Message `INTERFACE` ```go @@ -230,6 +235,7 @@ type Message[P comparable] interface { GetProducer() P } ``` + ### Producer `INTERFACE` ```go diff --git a/server/internal/logger/README.md b/server/internal/logger/README.md index a4225b9..ca79363 100644 --- a/server/internal/logger/README.md +++ b/server/internal/logger/README.md @@ -16,14 +16,15 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Ants](#ants)|暂无描述... -|`STRUCT`|[GNet](#gnet)|暂无描述... +|`STRUCT`|[Ants](#struct_Ants)|暂无描述... +|`STRUCT`|[GNet](#struct_GNet)|暂无描述... *** ## 详情信息 + ### Ants `STRUCT` ```go @@ -31,6 +32,7 @@ type Ants struct{} ``` #### func (*Ants) Printf(format string, args ...interface {}) *** + ### GNet `STRUCT` ```go diff --git a/server/lockstep/README.md b/server/lockstep/README.md index f7a5a72..4f9f147 100644 --- a/server/lockstep/README.md +++ b/server/lockstep/README.md @@ -27,10 +27,10 @@ |类型|名称|描述 |:--|:--|:-- -|`INTERFACE`|[Client](#client)|帧同步客户端接口定义 -|`STRUCT`|[StoppedEventHandle](#stoppedeventhandle)|暂无描述... -|`STRUCT`|[Lockstep](#lockstep)|锁步(帧)同步默认实现 -|`STRUCT`|[Option](#option)|暂无描述... +|`INTERFACE`|[Client](#struct_Client)|帧同步客户端接口定义 +|`STRUCT`|[StoppedEventHandle](#struct_StoppedEventHandle)|暂无描述... +|`STRUCT`|[Lockstep](#struct_Lockstep)|锁步(帧)同步默认实现 +|`STRUCT`|[Option](#struct_Option)|暂无描述... @@ -108,6 +108,7 @@ func TestNewLockstep(t *testing.T) { > - 默认情况下为 0,即第一帧索引为 0 *** + ### Client `INTERFACE` 帧同步客户端接口定义 - 客户端应该具备ID及写入数据包的实现 @@ -117,11 +118,13 @@ type Client[ID comparable] interface { Write(packet []byte, callback ...func(err error)) } ``` + ### StoppedEventHandle `STRUCT` ```go type StoppedEventHandle[ClientID comparable, Command any] func(lockstep *Lockstep[ClientID, Command]) ``` + ### Lockstep `STRUCT` 锁步(帧)同步默认实现 - 支持最大帧上限 WithFrameLimit @@ -149,6 +152,7 @@ type Lockstep[ClientID comparable, Command any] struct { lockstepStoppedEventHandles []StoppedEventHandle[ClientID, Command] } ``` + ### Option `STRUCT` ```go diff --git a/server/router/README.md b/server/router/README.md index 7a470bc..aa0095f 100644 --- a/server/router/README.md +++ b/server/router/README.md @@ -24,9 +24,9 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[MultistageBind](#multistagebind)|多级分类路由绑定函数 -|`STRUCT`|[Multistage](#multistage)|支持多级分类的路由器 -|`STRUCT`|[MultistageOption](#multistageoption)|路由器选项 +|`STRUCT`|[MultistageBind](#struct_MultistageBind)|多级分类路由绑定函数 +|`STRUCT`|[Multistage](#struct_Multistage)|支持多级分类的路由器 +|`STRUCT`|[MultistageOption](#struct_MultistageOption)|路由器选项 @@ -53,6 +53,7 @@ func ExampleNewMultistage() { > - 将在路由注册前对路由进行对应处理 *** + ### MultistageBind `STRUCT` 多级分类路由绑定函数 ```go @@ -61,6 +62,7 @@ type MultistageBind[HandleFunc any] func(HandleFunc) #### func (MultistageBind) Bind(handleFunc HandleFunc) > 将处理函数绑定到预设的路由中 *** + ### Multistage `STRUCT` 支持多级分类的路由器 ```go @@ -164,6 +166,7 @@ func ExampleMultistage_Sub() { ``` *** + ### MultistageOption `STRUCT` 路由器选项 ```go diff --git a/server/writeloop/README.md b/server/writeloop/README.md index 173ca78..42f8feb 100644 --- a/server/writeloop/README.md +++ b/server/writeloop/README.md @@ -24,9 +24,9 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Channel](#channel)|基于 chan 的写循环,与 Unbounded 相同,但是使用 Channel 实现 -|`STRUCT`|[Unbounded](#unbounded)|写循环 -|`INTERFACE`|[WriteLoop](#writeloop)|暂无描述... +|`STRUCT`|[Channel](#struct_Channel)|基于 chan 的写循环,与 Unbounded 相同,但是使用 Channel 实现 +|`STRUCT`|[Unbounded](#struct_Unbounded)|写循环 +|`INTERFACE`|[WriteLoop](#struct_WriteLoop)|暂无描述... @@ -106,6 +106,7 @@ func TestNewUnbounded(t *testing.T) { *** + ### Channel `STRUCT` 基于 chan 的写循环,与 Unbounded 相同,但是使用 Channel 实现 ```go @@ -119,6 +120,7 @@ type Channel[T any] struct { #### func (*Channel) Close() > 关闭写循环 *** + ### Unbounded `STRUCT` 写循环 - 用于将数据并发安全的写入到底层连接 @@ -217,6 +219,7 @@ func TestUnbounded_Close(t *testing.T) { *** + ### WriteLoop `INTERFACE` ```go diff --git a/utils/aoi/README.md b/utils/aoi/README.md index c03f1f6..02bc926 100644 --- a/utils/aoi/README.md +++ b/utils/aoi/README.md @@ -28,9 +28,9 @@ AOI 问题是在大规模多人在线游戏中常见的问题,它涉及到确 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[TwoDimensional](#twodimensional)|暂无描述... -|`INTERFACE`|[TwoDimensionalEntity](#twodimensionalentity)|基于2D定义的AOI对象功能接口 -|`STRUCT`|[EntityJoinVisionEventHandle](#entityjoinvisioneventhandle)|暂无描述... +|`STRUCT`|[TwoDimensional](#struct_TwoDimensional)|暂无描述... +|`INTERFACE`|[TwoDimensionalEntity](#struct_TwoDimensionalEntity)|基于2D定义的AOI对象功能接口 +|`STRUCT`|[EntityJoinVisionEventHandle](#struct_EntityJoinVisionEventHandle)|暂无描述... @@ -65,6 +65,7 @@ func TestNewTwoDimensional(t *testing.T) { *** + ### TwoDimensional `STRUCT` ```go @@ -82,6 +83,7 @@ type TwoDimensional[EID generic.Basic, PosType generic.SignedNumber, E TwoDimens repartitionQueue []func() } ``` + ### TwoDimensionalEntity `INTERFACE` 基于2D定义的AOI对象功能接口 - AOI 对象提供了 AOI 系统中常用的属性,诸如位置坐标和视野范围等 @@ -92,6 +94,7 @@ type TwoDimensionalEntity[EID generic.Basic, PosType generic.SignedNumber] inter GetPosition() geometry.Point[PosType] } ``` + ### EntityJoinVisionEventHandle `STRUCT` ```go diff --git a/utils/arrangement/README.md b/utils/arrangement/README.md index 8caab46..e06b770 100644 --- a/utils/arrangement/README.md +++ b/utils/arrangement/README.md @@ -34,16 +34,16 @@ arrangement 包提供了一些有用的函数来处理数组的排列。 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Area](#area)|编排区域 -|`STRUCT`|[AreaOption](#areaoption)|编排区域选项 -|`STRUCT`|[AreaConstraintHandle](#areaconstrainthandle)|暂无描述... -|`STRUCT`|[Arrangement](#arrangement)|用于针对多条数据进行合理编排的数据结构 -|`STRUCT`|[Editor](#editor)|提供了大量辅助函数的编辑器 -|`INTERFACE`|[Item](#item)|编排成员 -|`STRUCT`|[ItemOption](#itemoption)|编排成员选项 -|`STRUCT`|[ItemFixedAreaHandle](#itemfixedareahandle)|暂无描述... -|`STRUCT`|[Option](#option)|编排选项 -|`STRUCT`|[ConstraintHandle](#constrainthandle)|暂无描述... +|`STRUCT`|[Area](#struct_Area)|编排区域 +|`STRUCT`|[AreaOption](#struct_AreaOption)|编排区域选项 +|`STRUCT`|[AreaConstraintHandle](#struct_AreaConstraintHandle)|暂无描述... +|`STRUCT`|[Arrangement](#struct_Arrangement)|用于针对多条数据进行合理编排的数据结构 +|`STRUCT`|[Editor](#struct_Editor)|提供了大量辅助函数的编辑器 +|`INTERFACE`|[Item](#struct_Item)|编排成员 +|`STRUCT`|[ItemOption](#struct_ItemOption)|编排成员选项 +|`STRUCT`|[ItemFixedAreaHandle](#struct_ItemFixedAreaHandle)|暂无描述... +|`STRUCT`|[Option](#struct_Option)|编排选项 +|`STRUCT`|[ConstraintHandle](#struct_ConstraintHandle)|暂无描述... @@ -115,6 +115,7 @@ arrangement 包提供了一些有用的函数来处理数组的排列。 > - 当所有的冲突处理函数都无法处理冲突时,将会进入下一个编排区域的尝试,如果均无法完成,将会将该成员加入到编排队列的末端,等待下一次编排 *** + ### Area `STRUCT` 编排区域 ```go @@ -126,16 +127,19 @@ type Area[ID comparable, AreaInfo any] struct { evaluate AreaEvaluateHandle[ID, AreaInfo] } ``` + ### AreaOption `STRUCT` 编排区域选项 ```go type AreaOption[ID comparable, AreaInfo any] func(area *Area[ID, AreaInfo]) ``` + ### AreaConstraintHandle `STRUCT` ```go type AreaConstraintHandle[ID comparable, AreaInfo any] func(area *Area[ID, AreaInfo], item Item[ID]) error ``` + ### Arrangement `STRUCT` 用于针对多条数据进行合理编排的数据结构 - 我不知道这个数据结构的具体用途,但是我觉得这个数据结构应该是有用的 @@ -153,6 +157,7 @@ type Arrangement[ID comparable, AreaInfo any] struct { conflictHandles []ConflictHandle[ID, AreaInfo] } ``` + ### Editor `STRUCT` 提供了大量辅助函数的编辑器 ```go @@ -164,6 +169,7 @@ type Editor[ID comparable, AreaInfo any] struct { retryCount int } ``` + ### Item `INTERFACE` 编排成员 ```go @@ -172,21 +178,25 @@ type Item[ID comparable] interface { Equal(item Item[ID]) bool } ``` + ### ItemOption `STRUCT` 编排成员选项 ```go type ItemOption[ID comparable, AreaInfo any] func(arrangement *Arrangement[ID, AreaInfo], item Item[ID]) ``` + ### ItemFixedAreaHandle `STRUCT` ```go type ItemFixedAreaHandle[AreaInfo any] func(areaInfo AreaInfo) bool ``` + ### Option `STRUCT` 编排选项 ```go type Option[ID comparable, AreaInfo any] func(arrangement *Arrangement[ID, AreaInfo]) ``` + ### ConstraintHandle `STRUCT` ```go diff --git a/utils/buffer/README.md b/utils/buffer/README.md index b0f0d88..b96e2b3 100644 --- a/utils/buffer/README.md +++ b/utils/buffer/README.md @@ -31,9 +31,9 @@ buffer 提供了缓冲区相关的实用程序。 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Ring](#ring)|环形缓冲区 -|`STRUCT`|[RingUnbounded](#ringunbounded)|基于环形缓冲区实现的无界缓冲区 -|`STRUCT`|[Unbounded](#unbounded)|是无界缓冲区的实现 +|`STRUCT`|[Ring](#struct_Ring)|环形缓冲区 +|`STRUCT`|[RingUnbounded](#struct_RingUnbounded)|基于环形缓冲区实现的无界缓冲区 +|`STRUCT`|[Unbounded](#struct_Unbounded)|是无界缓冲区的实现 @@ -82,6 +82,7 @@ func TestNewRing(t *testing.T) { > - 该缓冲区的所有方法都是线程安全的,除了用于同步的互斥锁外,不会阻塞任何东西 *** + ### Ring `STRUCT` 环形缓冲区 ```go @@ -160,6 +161,7 @@ func BenchmarkRing_Write(b *testing.B) { #### func (*Ring) Reset() > 重置缓冲区 *** + ### RingUnbounded `STRUCT` 基于环形缓冲区实现的无界缓冲区 ```go @@ -255,6 +257,7 @@ func TestRingUnbounded_Close(t *testing.T) { *** + ### Unbounded `STRUCT` 是无界缓冲区的实现 ```go diff --git a/utils/collection/README.md b/utils/collection/README.md index b9663e9..4850246 100644 --- a/utils/collection/README.md +++ b/utils/collection/README.md @@ -133,8 +133,8 @@ collection 用于对 input 和 map 操作的工具函数 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[ComparisonHandler](#comparisonhandler)|暂无描述... -|`STRUCT`|[OrderedValueGetter](#orderedvaluegetter)|暂无描述... +|`STRUCT`|[ComparisonHandler](#struct_ComparisonHandler)|暂无描述... +|`STRUCT`|[OrderedValueGetter](#struct_OrderedValueGetter)|暂无描述... @@ -5411,11 +5411,13 @@ func TestShuffleByClone(t *testing.T) { *** + ### ComparisonHandler `STRUCT` ```go type ComparisonHandler[V any] func(source V) bool ``` + ### OrderedValueGetter `STRUCT` ```go diff --git a/utils/collection/listings/README.md b/utils/collection/listings/README.md index 0ea0d9f..9179267 100644 --- a/utils/collection/listings/README.md +++ b/utils/collection/listings/README.md @@ -26,10 +26,10 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Matrix](#matrix)|暂无描述... -|`STRUCT`|[PagedSlice](#pagedslice)|是一个高效的动态数组,它通过分页管理内存并减少频繁的内存分配来提高性能。 -|`STRUCT`|[PrioritySlice](#priorityslice)|是一个优先级切片 -|`STRUCT`|[SyncSlice](#syncslice)|是基于 sync.RWMutex 实现的线程安全的 slice +|`STRUCT`|[Matrix](#struct_Matrix)|暂无描述... +|`STRUCT`|[PagedSlice](#struct_PagedSlice)|是一个高效的动态数组,它通过分页管理内存并减少频繁的内存分配来提高性能。 +|`STRUCT`|[PrioritySlice](#struct_PrioritySlice)|是一个优先级切片 +|`STRUCT`|[SyncSlice](#struct_SyncSlice)|是基于 sync.RWMutex 实现的线程安全的 slice @@ -56,6 +56,7 @@ > 创建一个 SyncSlice *** + ### Matrix `STRUCT` ```go @@ -76,6 +77,7 @@ type Matrix[V any] struct { #### func (*Matrix) Clear() > 清空矩阵。 *** + ### PagedSlice `STRUCT` 是一个高效的动态数组,它通过分页管理内存并减少频繁的内存分配来提高性能。 ```go @@ -104,6 +106,7 @@ type PagedSlice[T any] struct { #### func (*PagedSlice) Range(f func (index int, value T) bool) > 迭代 PagedSlice 中的所有元素。 *** + ### PrioritySlice `STRUCT` 是一个优先级切片 ```go @@ -181,6 +184,7 @@ func TestPrioritySlice_Append(t *testing.T) { #### func (*PrioritySlice) String() string > 返回切片字符串 *** + ### SyncSlice `STRUCT` 是基于 sync.RWMutex 实现的线程安全的 slice ```go diff --git a/utils/collection/mappings/README.md b/utils/collection/mappings/README.md index f4910eb..270393b 100644 --- a/utils/collection/mappings/README.md +++ b/utils/collection/mappings/README.md @@ -23,7 +23,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[SyncMap](#syncmap)|是基于 sync.RWMutex 实现的线程安全的 map +|`STRUCT`|[SyncMap](#struct_SyncMap)|是基于 sync.RWMutex 实现的线程安全的 map @@ -35,6 +35,7 @@ > 创建一个 SyncMap *** + ### SyncMap `STRUCT` 是基于 sync.RWMutex 实现的线程安全的 map - 适用于要考虑并发读写但是并发读写的频率不高的情况 diff --git a/utils/combination/README.md b/utils/combination/README.md index 2826bbe..bbe8837 100644 --- a/utils/combination/README.md +++ b/utils/combination/README.md @@ -52,13 +52,13 @@ combination 包提供了一些实用的组合函数。 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Combination](#combination)|用于从多个匹配器内提取组合的数据结构 -|`STRUCT`|[Option](#option)|组合器选项 -|`INTERFACE`|[Item](#item)|暂无描述... -|`STRUCT`|[Matcher](#matcher)|用于从一组数据内提取组合的数据结构 -|`STRUCT`|[MatcherOption](#matcheroption)|匹配器选项 -|`STRUCT`|[Validator](#validator)|用于对组合进行验证的校验器 -|`STRUCT`|[ValidatorOption](#validatoroption)|暂无描述... +|`STRUCT`|[Combination](#struct_Combination)|用于从多个匹配器内提取组合的数据结构 +|`STRUCT`|[Option](#struct_Option)|组合器选项 +|`INTERFACE`|[Item](#struct_Item)|暂无描述... +|`STRUCT`|[Matcher](#struct_Matcher)|用于从一组数据内提取组合的数据结构 +|`STRUCT`|[MatcherOption](#struct_MatcherOption)|匹配器选项 +|`STRUCT`|[Validator](#struct_Validator)|用于对组合进行验证的校验器 +|`STRUCT`|[ValidatorOption](#struct_ValidatorOption)|暂无描述... @@ -241,6 +241,7 @@ combination 包提供了一些实用的组合函数。 > - getType: 用于获取组合中元素的类型,用于判断是否相同 *** + ### Combination `STRUCT` 用于从多个匹配器内提取组合的数据结构 ```go @@ -304,16 +305,19 @@ func TestCombination_Best(t *testing.T) { #### func (*Combination) Worst(items []T) (name string, result []T) > 从一组数据中提取符合匹配器规则的最差组合 *** + ### Option `STRUCT` 组合器选项 ```go type Option[T Item] func(*Combination[T]) ``` + ### Item `INTERFACE` ```go type Item interface{} ``` + ### Matcher `STRUCT` 用于从一组数据内提取组合的数据结构 ```go @@ -335,11 +339,13 @@ type Matcher[T Item] struct { #### func (*Matcher) Worst(items []T) []T > 从一组数据中提取符筛选器规则的最差组合 *** + ### MatcherOption `STRUCT` 匹配器选项 ```go type MatcherOption[T Item] func(matcher *Matcher[T]) ``` + ### Validator `STRUCT` 用于对组合进行验证的校验器 ```go @@ -382,6 +388,7 @@ func TestValidator_Validate(t *testing.T) { *** + ### ValidatorOption `STRUCT` ```go diff --git a/utils/deck/README.md b/utils/deck/README.md index 3c95f23..3bfbca8 100644 --- a/utils/deck/README.md +++ b/utils/deck/README.md @@ -24,9 +24,9 @@ deck 包中的内容用于针对一堆内容的管理,适用但不限于牌堆 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Deck](#deck)|甲板,用于针对一堆 Group 进行管理的数据结构 -|`STRUCT`|[Group](#group)|甲板中的组,用于针对一堆内容进行管理的数据结构 -|`INTERFACE`|[Item](#item)|甲板成员 +|`STRUCT`|[Deck](#struct_Deck)|甲板,用于针对一堆 Group 进行管理的数据结构 +|`STRUCT`|[Group](#struct_Group)|甲板中的组,用于针对一堆内容进行管理的数据结构 +|`INTERFACE`|[Item](#struct_Item)|甲板成员 @@ -43,6 +43,7 @@ deck 包中的内容用于针对一堆内容的管理,适用但不限于牌堆 > 创建一个新的组 *** + ### Deck `STRUCT` 甲板,用于针对一堆 Group 进行管理的数据结构 ```go @@ -72,6 +73,7 @@ type Deck[I Item] struct { #### func (*Deck) GetPrev(guid int64) *Group[I] > 获取特定组的上一个组 *** + ### Group `STRUCT` 甲板中的组,用于针对一堆内容进行管理的数据结构 ```go @@ -126,6 +128,7 @@ type Group[I Item] struct { #### func (*Group) GetItem(index int) I > 获取组中的指定内容 *** + ### Item `INTERFACE` 甲板成员 ```go diff --git a/utils/fsm/README.md b/utils/fsm/README.md index 0661ad2..330019f 100644 --- a/utils/fsm/README.md +++ b/utils/fsm/README.md @@ -28,8 +28,8 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[FSM](#fsm)|状态机 -|`STRUCT`|[Option](#option)|暂无描述... +|`STRUCT`|[FSM](#struct_FSM)|状态机 +|`STRUCT`|[Option](#struct_Option)|暂无描述... @@ -69,6 +69,7 @@ > - 该阶段状态机的状态为新的状态,而非退出前的状态 *** + ### FSM `STRUCT` 状态机 ```go @@ -84,6 +85,7 @@ type FSM[State comparable, Data any] struct { exitAfterEventHandles map[State][]func(state *FSM[State, Data]) } ``` + ### Option `STRUCT` ```go diff --git a/utils/generator/astgo/README.md b/utils/generator/astgo/README.md index a8edb18..3d775cb 100644 --- a/utils/generator/astgo/README.md +++ b/utils/generator/astgo/README.md @@ -23,13 +23,13 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Comment](#comment)|暂无描述... -|`STRUCT`|[Field](#field)|暂无描述... -|`STRUCT`|[File](#file)|暂无描述... -|`STRUCT`|[Function](#function)|暂无描述... -|`STRUCT`|[Package](#package)|暂无描述... -|`STRUCT`|[Struct](#struct)|暂无描述... -|`STRUCT`|[Type](#type)|暂无描述... +|`STRUCT`|[Comment](#struct_Comment)|暂无描述... +|`STRUCT`|[Field](#struct_Field)|暂无描述... +|`STRUCT`|[File](#struct_File)|暂无描述... +|`STRUCT`|[Function](#struct_Function)|暂无描述... +|`STRUCT`|[Package](#struct_Package)|暂无描述... +|`STRUCT`|[Struct](#struct_Struct)|暂无描述... +|`STRUCT`|[Type](#struct_Type)|暂无描述... @@ -60,6 +60,7 @@ func TestNewPackage(t *testing.T) { *** + ### Comment `STRUCT` ```go @@ -68,6 +69,7 @@ type Comment struct { Clear []string } ``` + ### Field `STRUCT` ```go @@ -78,6 +80,7 @@ type Field struct { Comments *Comment } ``` + ### File `STRUCT` ```go @@ -92,6 +95,7 @@ type File struct { ``` #### func (*File) Package() string *** + ### Function `STRUCT` ```go @@ -112,6 +116,7 @@ type Function struct { ``` #### func (*Function) Code() string *** + ### Package `STRUCT` ```go @@ -137,6 +142,7 @@ type Package struct { *** #### func (*Package) GetBenchmarkTest(f *Function) *Function *** + ### Struct `STRUCT` ```go @@ -151,6 +157,7 @@ type Struct struct { Test bool } ``` + ### Type `STRUCT` ```go diff --git a/utils/generator/genreadme/README.md b/utils/generator/genreadme/README.md index 6ead52e..04c96d0 100644 --- a/utils/generator/genreadme/README.md +++ b/utils/generator/genreadme/README.md @@ -23,7 +23,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Builder](#builder)|暂无描述... +|`STRUCT`|[Builder](#struct_Builder)|暂无描述... @@ -34,6 +34,7 @@ *** + ### Builder `STRUCT` ```go diff --git a/utils/generator/genreadme/builder.go b/utils/generator/genreadme/builder.go index 343656b..e4ea42b 100644 --- a/utils/generator/genreadme/builder.go +++ b/utils/generator/genreadme/builder.go @@ -115,7 +115,7 @@ func (b *Builder) genMenus() { structGen() b.tableRow( super.If(structInfo.Interface, "`INTERFACE`", "`STRUCT`"), - fmt.Sprintf("[%s](#%s)", structInfo.Name, strings.ToLower(structInfo.Name)), + fmt.Sprintf("[%s](#struct_%s)", structInfo.Name, structInfo.Name), collection.FindFirstOrDefaultInSlice(structInfo.Comments.Clear, "暂无描述..."), ) } @@ -199,6 +199,7 @@ func (b *Builder) genStructs() { continue } titleBuild() + b.newLine(fmt.Sprintf(``, structInfo.Name)) b.title(3, fmt.Sprintf("%s `%s`", structInfo.Name, super.If(structInfo.Interface, "INTERFACE", "STRUCT"))) b.newLine(structInfo.Comments.Clear...) b.newLine("```go") diff --git a/utils/generic/README.md b/utils/generic/README.md index 90c71d6..b4deb86 100644 --- a/utils/generic/README.md +++ b/utils/generic/README.md @@ -27,21 +27,21 @@ generic 目的在于提供一组基于泛型的用于处理通用功能的函数 |类型|名称|描述 |:--|:--|:-- -|`INTERFACE`|[IdR](#idr)|暂无描述... -|`INTERFACE`|[IDR](#idr)|暂无描述... -|`INTERFACE`|[IdW](#idw)|暂无描述... -|`INTERFACE`|[IDW](#idw)|暂无描述... -|`INTERFACE`|[IdR2W](#idr2w)|暂无描述... -|`INTERFACE`|[IDR2W](#idr2w)|暂无描述... -|`INTERFACE`|[Ordered](#ordered)|可排序类型 -|`INTERFACE`|[Number](#number)|数字类型 -|`INTERFACE`|[SignedNumber](#signednumber)|有符号数字类型 -|`INTERFACE`|[Integer](#integer)|整数类型 -|`INTERFACE`|[Signed](#signed)|有符号整数类型 -|`INTERFACE`|[Unsigned](#unsigned)|无符号整数类型 -|`INTERFACE`|[UnsignedNumber](#unsignednumber)|无符号数字类型 -|`INTERFACE`|[Float](#float)|浮点类型 -|`INTERFACE`|[Basic](#basic)|基本类型 +|`INTERFACE`|[IdR](#struct_IdR)|暂无描述... +|`INTERFACE`|[IDR](#struct_IDR)|暂无描述... +|`INTERFACE`|[IdW](#struct_IdW)|暂无描述... +|`INTERFACE`|[IDW](#struct_IDW)|暂无描述... +|`INTERFACE`|[IdR2W](#struct_IdR2W)|暂无描述... +|`INTERFACE`|[IDR2W](#struct_IDR2W)|暂无描述... +|`INTERFACE`|[Ordered](#struct_Ordered)|可排序类型 +|`INTERFACE`|[Number](#struct_Number)|数字类型 +|`INTERFACE`|[SignedNumber](#struct_SignedNumber)|有符号数字类型 +|`INTERFACE`|[Integer](#struct_Integer)|整数类型 +|`INTERFACE`|[Signed](#struct_Signed)|有符号整数类型 +|`INTERFACE`|[Unsigned](#struct_Unsigned)|无符号整数类型 +|`INTERFACE`|[UnsignedNumber](#struct_UnsignedNumber)|无符号数字类型 +|`INTERFACE`|[Float](#struct_Float)|浮点类型 +|`INTERFACE`|[Basic](#struct_Basic)|基本类型 @@ -63,6 +63,7 @@ generic 目的在于提供一组基于泛型的用于处理通用功能的函数 > 检查指定的值是否存在 nil *** + ### IdR `INTERFACE` ```go @@ -70,6 +71,7 @@ type IdR[ID comparable] interface { GetId() ID } ``` + ### IDR `INTERFACE` ```go @@ -77,6 +79,7 @@ type IDR[ID comparable] interface { GetID() ID } ``` + ### IdW `INTERFACE` ```go @@ -84,6 +87,7 @@ type IdW[ID comparable] interface { SetId(id ID) } ``` + ### IDW `INTERFACE` ```go @@ -91,6 +95,7 @@ type IDW[ID comparable] interface { SetID(id ID) } ``` + ### IdR2W `INTERFACE` ```go @@ -99,6 +104,7 @@ type IdR2W[ID comparable] interface { IdW[ID] } ``` + ### IDR2W `INTERFACE` ```go @@ -107,6 +113,7 @@ type IDR2W[ID comparable] interface { IDW[ID] } ``` + ### Ordered `INTERFACE` 可排序类型 ```go @@ -114,6 +121,7 @@ type Ordered interface { Integer | Float | ~string } ``` + ### Number `INTERFACE` 数字类型 ```go @@ -121,6 +129,7 @@ type Number interface { Integer | Float } ``` + ### SignedNumber `INTERFACE` 有符号数字类型 ```go @@ -128,6 +137,7 @@ type SignedNumber interface { Signed | Float } ``` + ### Integer `INTERFACE` 整数类型 ```go @@ -135,6 +145,7 @@ type Integer interface { Signed | Unsigned } ``` + ### Signed `INTERFACE` 有符号整数类型 ```go @@ -142,6 +153,7 @@ type Signed interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 } ``` + ### Unsigned `INTERFACE` 无符号整数类型 ```go @@ -149,6 +161,7 @@ type Unsigned interface { UnsignedNumber | ~uintptr } ``` + ### UnsignedNumber `INTERFACE` 无符号数字类型 ```go @@ -156,6 +169,7 @@ type UnsignedNumber interface { ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 } ``` + ### Float `INTERFACE` 浮点类型 ```go @@ -163,6 +177,7 @@ type Float interface { ~float32 | ~float64 } ``` + ### Basic `INTERFACE` 基本类型 ```go diff --git a/utils/geometry/README.md b/utils/geometry/README.md index 1d3055e..9bed1fc 100644 --- a/utils/geometry/README.md +++ b/utils/geometry/README.md @@ -117,15 +117,15 @@ geometry 旨在提供一组用于处理几何形状和计算几何属性的函 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Circle](#circle)|圆形 -|`STRUCT`|[FloorPlan](#floorplan)|平面图 -|`STRUCT`|[Direction](#direction)|方向 -|`STRUCT`|[LineSegment](#linesegment)|通过两个点表示一根线段 -|`STRUCT`|[LineSegmentCap](#linesegmentcap)|可以包含一份额外数据的线段 -|`STRUCT`|[Point](#point)|表示了一个由 x、y 坐标组成的点 -|`STRUCT`|[PointCap](#pointcap)|表示了一个由 x、y 坐标组成的点,这个点具有一个数据容量 -|`STRUCT`|[Shape](#shape)|通过多个点表示了一个形状 -|`STRUCT`|[ShapeSearchOption](#shapesearchoption)|图形搜索可选项,用于 Shape.ShapeSearch 搜索支持 +|`STRUCT`|[Circle](#struct_Circle)|圆形 +|`STRUCT`|[FloorPlan](#struct_FloorPlan)|平面图 +|`STRUCT`|[Direction](#struct_Direction)|方向 +|`STRUCT`|[LineSegment](#struct_LineSegment)|通过两个点表示一根线段 +|`STRUCT`|[LineSegmentCap](#struct_LineSegmentCap)|可以包含一份额外数据的线段 +|`STRUCT`|[Point](#struct_Point)|表示了一个由 x、y 坐标组成的点 +|`STRUCT`|[PointCap](#struct_PointCap)|表示了一个由 x、y 坐标组成的点,这个点具有一个数据容量 +|`STRUCT`|[Shape](#struct_Shape)|通过多个点表示了一个形状 +|`STRUCT`|[ShapeSearchOption](#struct_ShapeSearchOption)|图形搜索可选项,用于 Shape.ShapeSearch 搜索支持 @@ -864,6 +864,7 @@ func TestNewShapeWithString(t *testing.T) { > 通过降序的方式进行搜索 *** + ### Circle `STRUCT` 圆形 ```go @@ -889,6 +890,7 @@ type Circle[V generic.SignedNumber] struct { #### func (Circle) CentroidDistance(circle Circle[V]) V > 计算与另一个圆的质心距离 *** + ### FloorPlan `STRUCT` 平面图 ```go @@ -906,11 +908,13 @@ type FloorPlan []string #### func (FloorPlan) String() string > 获取平面图结果 *** + ### Direction `STRUCT` 方向 ```go type Direction uint8 ``` + ### LineSegment `STRUCT` 通过两个点表示一根线段 ```go @@ -928,6 +932,7 @@ type LineSegment[V generic.SignedNumber] [2]Point[V] #### func (LineSegment) GetLength() V > 获取该线段的长度 *** + ### LineSegmentCap `STRUCT` 可以包含一份额外数据的线段 ```go @@ -936,6 +941,7 @@ type LineSegmentCap[V generic.SignedNumber, Data any] struct { Data Data } ``` + ### Point `STRUCT` 表示了一个由 x、y 坐标组成的点 ```go @@ -989,6 +995,7 @@ type Point[V generic.SignedNumber] [2]V #### func (Point) Min(point Point[V]) Point[V] > 返回两个位置中每个维度的最小值组成的新的位置 *** + ### PointCap `STRUCT` 表示了一个由 x、y 坐标组成的点,这个点具有一个数据容量 ```go @@ -997,6 +1004,7 @@ type PointCap[V generic.SignedNumber, D any] struct { Data D } ``` + ### Shape `STRUCT` 通过多个点表示了一个形状 ```go @@ -1139,6 +1147,7 @@ func ExampleShape_ShapeSearch() { #### func (Shape) IsPointOnEdge(point Point[V]) bool > 检查点是否在该形状的一条边上 *** + ### ShapeSearchOption `STRUCT` 图形搜索可选项,用于 Shape.ShapeSearch 搜索支持 ```go diff --git a/utils/geometry/astar/README.md b/utils/geometry/astar/README.md index c8e8540..938465c 100644 --- a/utils/geometry/astar/README.md +++ b/utils/geometry/astar/README.md @@ -28,7 +28,7 @@ astar 提供用于实现 A* 算法的函数和数据结构。A* 算法是一种 |类型|名称|描述 |:--|:--|:-- -|`INTERFACE`|[Graph](#graph)|适用于 A* 算法的图数据结构接口定义,表示导航网格,其中包含了节点和连接节点的边。 +|`INTERFACE`|[Graph](#struct_Graph)|适用于 A* 算法的图数据结构接口定义,表示导航网格,其中包含了节点和连接节点的边。 @@ -77,6 +77,7 @@ func ExampleFind() { ``` *** + ### Graph `INTERFACE` 适用于 A* 算法的图数据结构接口定义,表示导航网格,其中包含了节点和连接节点的边。 ```go diff --git a/utils/geometry/dp/README.md b/utils/geometry/dp/README.md index 3b22ddc..0250b7d 100644 --- a/utils/geometry/dp/README.md +++ b/utils/geometry/dp/README.md @@ -27,8 +27,8 @@ dp (DistributionPattern) 提供用于在二维数组中根据不同的特征标 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[DistributionPattern](#distributionpattern)|分布图 -|`STRUCT`|[Link](#link)|暂无描述... +|`STRUCT`|[DistributionPattern](#struct_DistributionPattern)|分布图 +|`STRUCT`|[Link](#struct_Link)|暂无描述... @@ -69,6 +69,7 @@ func TestNewDistributionPattern(t *testing.T) { *** + ### DistributionPattern `STRUCT` 分布图 ```go @@ -104,6 +105,7 @@ type DistributionPattern[Item any] struct { > 通过特定的成员刷新特定位置的分布关系 > - 如果矩阵通过 LoadMatrixWithPos 加载,将会重定向至 Refresh *** + ### Link `STRUCT` ```go diff --git a/utils/geometry/matrix/README.md b/utils/geometry/matrix/README.md index 691e139..9d45d0e 100644 --- a/utils/geometry/matrix/README.md +++ b/utils/geometry/matrix/README.md @@ -23,7 +23,7 @@ matrix 提供了一个简单的二维数组的实现 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Matrix](#matrix)|二维矩阵 +|`STRUCT`|[Matrix](#struct_Matrix)|二维矩阵 @@ -37,6 +37,7 @@ matrix 提供了一个简单的二维数组的实现 > - 该矩阵为XY,而非YX *** + ### Matrix `STRUCT` 二维矩阵 ```go diff --git a/utils/geometry/navmesh/README.md b/utils/geometry/navmesh/README.md index 9bdab61..657620b 100644 --- a/utils/geometry/navmesh/README.md +++ b/utils/geometry/navmesh/README.md @@ -26,7 +26,7 @@ navmesh 提供了用于导航网格处理的函数和数据结构。导航网格 |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[NavMesh](#navmesh)|暂无描述... +|`STRUCT`|[NavMesh](#struct_NavMesh)|暂无描述... @@ -54,6 +54,7 @@ navmesh 提供了用于导航网格处理的函数和数据结构。导航网格 > - 确保 NavMesh 计算精度的情况下,V 建议使用 float64 类型 *** + ### NavMesh `STRUCT` ```go diff --git a/utils/hub/README.md b/utils/hub/README.md index d350d93..d3bdaaa 100644 --- a/utils/hub/README.md +++ b/utils/hub/README.md @@ -23,7 +23,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[ObjectPool](#objectpool)|基于 sync.Pool 实现的线程安全的对象池 +|`STRUCT`|[ObjectPool](#struct_ObjectPool)|基于 sync.Pool 实现的线程安全的对象池 @@ -89,6 +89,7 @@ func TestNewObjectPool(t *testing.T) { *** + ### ObjectPool `STRUCT` 基于 sync.Pool 实现的线程安全的对象池 - 一些高频临时生成使用的对象可以通过 ObjectPool 进行管理,例如属性计算等 diff --git a/utils/huge/README.md b/utils/huge/README.md index 0a762ce..83c9e5b 100644 --- a/utils/huge/README.md +++ b/utils/huge/README.md @@ -26,8 +26,8 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Float](#float)|暂无描述... -|`STRUCT`|[Int](#int)|暂无描述... +|`STRUCT`|[Float](#struct_Float)|暂无描述... +|`STRUCT`|[Int](#struct_Int)|暂无描述... @@ -56,6 +56,7 @@ > - 如果字符串不是一个合法的数字,则返回 0 *** + ### Float `STRUCT` ```go @@ -117,6 +118,7 @@ type Float big.Float #### func (*Float) IsNegative() bool > 是否为负数 *** + ### Int `STRUCT` ```go diff --git a/utils/leaderboard/README.md b/utils/leaderboard/README.md index 15bcb62..9080f55 100644 --- a/utils/leaderboard/README.md +++ b/utils/leaderboard/README.md @@ -25,9 +25,9 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[BinarySearch](#binarysearch)|暂无描述... -|`STRUCT`|[BinarySearchRankChangeEventHandle](#binarysearchrankchangeeventhandle)|暂无描述... -|`STRUCT`|[BinarySearchOption](#binarysearchoption)|暂无描述... +|`STRUCT`|[BinarySearch](#struct_BinarySearch)|暂无描述... +|`STRUCT`|[BinarySearchRankChangeEventHandle](#struct_BinarySearchRankChangeEventHandle)|暂无描述... +|`STRUCT`|[BinarySearchOption](#struct_BinarySearchOption)|暂无描述... @@ -61,6 +61,7 @@ func ExampleNewBinarySearch() { > - 默认情况下为降序 *** + ### BinarySearch `STRUCT` ```go @@ -74,11 +75,13 @@ type BinarySearch[CompetitorID comparable, Score generic.Ordered] struct { rankClearBeforeEventHandles []BinarySearchRankClearBeforeEventHandle[CompetitorID, Score] } ``` + ### BinarySearchRankChangeEventHandle `STRUCT` ```go type BinarySearchRankChangeEventHandle[CompetitorID comparable, Score generic.Ordered] func(leaderboard *BinarySearch[CompetitorID, Score], competitorId CompetitorID, oldRank int, oldScore Score) ``` + ### BinarySearchOption `STRUCT` ```go diff --git a/utils/log/README.md b/utils/log/README.md index 37be9bb..7beab82 100644 --- a/utils/log/README.md +++ b/utils/log/README.md @@ -77,10 +77,10 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Field](#field)|暂无描述... -|`STRUCT`|[Logger](#logger)|暂无描述... -|`STRUCT`|[MultiHandler](#multihandler)|暂无描述... -|`STRUCT`|[Option](#option)|暂无描述... +|`STRUCT`|[Field](#struct_Field)|暂无描述... +|`STRUCT`|[Logger](#struct_Logger)|暂无描述... +|`STRUCT`|[MultiHandler](#struct_MultiHandler)|暂无描述... +|`STRUCT`|[Option](#struct_Option)|暂无描述... @@ -393,11 +393,13 @@ func TestStack(t *testing.T) { > 创建一个新的日志选项 *** + ### Field `STRUCT` ```go type Field slog.Attr ``` + ### Logger `STRUCT` ```go @@ -405,6 +407,7 @@ type Logger struct { *slog.Logger } ``` + ### MultiHandler `STRUCT` ```go @@ -420,6 +423,7 @@ type MultiHandler struct { *** #### func (MultiHandler) WithGroup(name string) slog.Handler *** + ### Option `STRUCT` ```go diff --git a/utils/log/survey/README.md b/utils/log/survey/README.md index 5e05d6f..f852995 100644 --- a/utils/log/survey/README.md +++ b/utils/log/survey/README.md @@ -32,13 +32,13 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Analyzer](#analyzer)|分析器 -|`INTERFACE`|[Flusher](#flusher)|用于刷新缓冲区的接口 -|`STRUCT`|[FileFlusher](#fileflusher)|暂无描述... -|`STRUCT`|[Option](#option)|选项 -|`STRUCT`|[Result](#result)|暂无描述... -|`STRUCT`|[R](#r)|记录器所记录的一条数据 -|`STRUCT`|[Report](#report)|分析报告 +|`STRUCT`|[Analyzer](#struct_Analyzer)|分析器 +|`INTERFACE`|[Flusher](#struct_Flusher)|用于刷新缓冲区的接口 +|`STRUCT`|[FileFlusher](#struct_FileFlusher)|暂无描述... +|`STRUCT`|[Option](#struct_Option)|选项 +|`STRUCT`|[Result](#struct_Result)|暂无描述... +|`STRUCT`|[R](#struct_R)|记录器所记录的一条数据 +|`STRUCT`|[Report](#struct_Report)|分析报告 @@ -153,6 +153,7 @@ func TestIncrementAnalyze(t *testing.T) { *** + ### Analyzer `STRUCT` 分析器 ```go @@ -214,6 +215,7 @@ type Analyzer struct { #### func (*Analyzer) GetValueString(key string) string > 获取当前记录的值 *** + ### Flusher `INTERFACE` 用于刷新缓冲区的接口 ```go @@ -222,6 +224,7 @@ type Flusher interface { Info() string } ``` + ### FileFlusher `STRUCT` ```go @@ -237,16 +240,19 @@ type FileFlusher struct { *** #### func (*FileFlusher) Info() string *** + ### Option `STRUCT` 选项 ```go type Option func(logger *logger) ``` + ### Result `STRUCT` ```go type Result gjson.Result ``` + ### R `STRUCT` 记录器所记录的一条数据 ```go @@ -280,6 +286,7 @@ type R string *** #### func (R) String() string *** + ### Report `STRUCT` 分析报告 ```go diff --git a/utils/maths/README.md b/utils/maths/README.md index 5d9170c..8bde01c 100644 --- a/utils/maths/README.md +++ b/utils/maths/README.md @@ -45,7 +45,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[CompareExpression](#compareexpression)|比较表达式 +|`STRUCT`|[CompareExpression](#struct_CompareExpression)|比较表达式 @@ -213,6 +213,7 @@ func TestMakeLastDigitsZero(t *testing.T) { *** + ### CompareExpression `STRUCT` 比较表达式 ```go diff --git a/utils/memory/README.md b/utils/memory/README.md index 2525618..3c23235 100644 --- a/utils/memory/README.md +++ b/utils/memory/README.md @@ -26,7 +26,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Option](#option)|暂无描述... +|`STRUCT`|[Option](#struct_Option)|暂无描述... @@ -96,6 +96,7 @@ func TestBindAction(t *testing.T) { *** + ### Option `STRUCT` ```go diff --git a/utils/moving/README.md b/utils/moving/README.md index 8cefd3d..164b235 100644 --- a/utils/moving/README.md +++ b/utils/moving/README.md @@ -27,10 +27,10 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[TwoDimensional](#twodimensional)|用于2D对象移动的数据结构 -|`INTERFACE`|[TwoDimensionalEntity](#twodimensionalentity)|2D移动对象接口定义 -|`STRUCT`|[Position2DChangeEventHandle](#position2dchangeeventhandle)|暂无描述... -|`STRUCT`|[TwoDimensionalOption](#twodimensionaloption)|暂无描述... +|`STRUCT`|[TwoDimensional](#struct_TwoDimensional)|用于2D对象移动的数据结构 +|`INTERFACE`|[TwoDimensionalEntity](#struct_TwoDimensionalEntity)|2D移动对象接口定义 +|`STRUCT`|[Position2DChangeEventHandle](#struct_Position2DChangeEventHandle)|暂无描述... +|`STRUCT`|[TwoDimensionalOption](#struct_TwoDimensionalOption)|暂无描述... @@ -95,6 +95,7 @@ func TestNewTwoDimensional(t *testing.T) { *** + ### TwoDimensional `STRUCT` 用于2D对象移动的数据结构 - 通过对象调用 MoveTo 方法后将开始执行该对象的移动 @@ -113,6 +114,7 @@ type TwoDimensional[EID generic.Basic, PosType generic.SignedNumber] struct { position2DStopMoveEventHandles []Position2DStopMoveEventHandle[EID, PosType] } ``` + ### TwoDimensionalEntity `INTERFACE` 2D移动对象接口定义 ```go @@ -123,11 +125,13 @@ type TwoDimensionalEntity[EID generic.Basic, PosType generic.SignedNumber] inter SetPosition(geometry.Point[PosType]) } ``` + ### Position2DChangeEventHandle `STRUCT` ```go type Position2DChangeEventHandle[EID generic.Basic, PosType generic.SignedNumber] func(moving *TwoDimensional[EID, PosType], entity TwoDimensionalEntity[EID, PosType], oldX PosType) ``` + ### TwoDimensionalOption `STRUCT` ```go diff --git a/utils/offset/README.md b/utils/offset/README.md index 4dd1b32..4c11c00 100644 --- a/utils/offset/README.md +++ b/utils/offset/README.md @@ -27,7 +27,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Time](#time)|带有偏移量的时间 +|`STRUCT`|[Time](#struct_Time)|带有偏移量的时间 @@ -59,6 +59,7 @@ > 获取当前时间偏移后的时间自从 t 以来经过的时间 *** + ### Time `STRUCT` 带有偏移量的时间 ```go diff --git a/utils/sole/README.md b/utils/sole/README.md index 786c068..5c238b0 100644 --- a/utils/sole/README.md +++ b/utils/sole/README.md @@ -38,7 +38,7 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[Once](#once)|用于数据取值去重的结构体 +|`STRUCT`|[Once](#struct_Once)|用于数据取值去重的结构体 @@ -125,6 +125,7 @@ > 获取一个自增的字符串 *** + ### Once `STRUCT` 用于数据取值去重的结构体 ```go diff --git a/utils/super/README.md b/utils/super/README.md index a3feb3f..700d5ad 100644 --- a/utils/super/README.md +++ b/utils/super/README.md @@ -92,12 +92,12 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[BitSet](#bitset)|是一个可以动态增长的比特位集合 -|`STRUCT`|[LossCounter](#losscounter)|暂无描述... -|`STRUCT`|[Matcher](#matcher)|匹配器 -|`STRUCT`|[Permission](#permission)|暂无描述... -|`STRUCT`|[StackGo](#stackgo)|用于获取上一个协程调用的堆栈信息 -|`STRUCT`|[VerifyHandle](#verifyhandle)|校验句柄 +|`STRUCT`|[BitSet](#struct_BitSet)|是一个可以动态增长的比特位集合 +|`STRUCT`|[LossCounter](#struct_LossCounter)|暂无描述... +|`STRUCT`|[Matcher](#struct_Matcher)|匹配器 +|`STRUCT`|[Permission](#struct_Permission)|暂无描述... +|`STRUCT`|[StackGo](#struct_StackGo)|用于获取上一个协程调用的堆栈信息 +|`STRUCT`|[VerifyHandle](#struct_VerifyHandle)|校验句柄 @@ -739,6 +739,7 @@ func BenchmarkCompareVersion(b *testing.B) { *** + ### BitSet `STRUCT` 是一个可以动态增长的比特位集合 - 默认情况下将使用 64 位无符号整数来表示比特位,当需要表示的比特位超过 64 位时,将自动增长 @@ -907,6 +908,7 @@ func TestBitSet_Shrink(t *testing.T) { #### func (*BitSet) UnmarshalJSON(data []byte) error > 实现 json.Unmarshaler 接口 *** + ### LossCounter `STRUCT` ```go @@ -924,6 +926,7 @@ type LossCounter struct { *** #### func (*LossCounter) String() string *** + ### Matcher `STRUCT` 匹配器 ```go @@ -933,6 +936,7 @@ type Matcher[Value any, Result any] struct { d bool } ``` + ### Permission `STRUCT` ```go @@ -941,6 +945,7 @@ type Permission[Code generic.Integer, EntityID comparable] struct { l sync.RWMutex } ``` + ### StackGo `STRUCT` 用于获取上一个协程调用的堆栈信息 - 应当最先运行 Wait 函数,然后在其他协程中调用 Stack 函数或者 GiveUp 函数 @@ -965,6 +970,7 @@ type StackGo struct { > - 在调用 Wait 函数后调用该函数,将会放弃收集消息堆栈并且释放资源 > - 在调用 GiveUp 函数后调用 Stack 函数,将会 panic *** + ### VerifyHandle `STRUCT` 校验句柄 ```go diff --git a/utils/timer/README.md b/utils/timer/README.md index 9200c3f..ab9b2f2 100644 --- a/utils/timer/README.md +++ b/utils/timer/README.md @@ -31,11 +31,11 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[SystemNewDayEventHandle](#systemnewdayeventhandle)|暂无描述... -|`STRUCT`|[Option](#option)|暂无描述... -|`STRUCT`|[Pool](#pool)|定时器池 -|`STRUCT`|[Scheduler](#scheduler)|调度器 -|`STRUCT`|[Ticker](#ticker)|定时器 +|`STRUCT`|[SystemNewDayEventHandle](#struct_SystemNewDayEventHandle)|暂无描述... +|`STRUCT`|[Option](#struct_Option)|暂无描述... +|`STRUCT`|[Pool](#struct_Pool)|定时器池 +|`STRUCT`|[Scheduler](#struct_Scheduler)|调度器 +|`STRUCT`|[Ticker](#struct_Ticker)|定时器 @@ -92,16 +92,19 @@ > 获取标准池中的一个定时器 *** + ### SystemNewDayEventHandle `STRUCT` ```go type SystemNewDayEventHandle func() ``` + ### Option `STRUCT` ```go type Option func(ticker *Ticker) ``` + ### Pool `STRUCT` 定时器池 ```go @@ -123,6 +126,7 @@ type Pool struct { > 释放定时器池的资源,释放后由其产生的 Ticker 在 Ticker.Release 后将不再回到池中,而是直接释放 > - 虽然定时器池已被释放,但是依旧可以产出 Ticker *** + ### Scheduler `STRUCT` 调度器 ```go @@ -150,6 +154,7 @@ type Scheduler struct { #### func (*Scheduler) Caller() > 可由外部发起调用的执行函数 *** + ### Ticker `STRUCT` 定时器 ```go diff --git a/utils/times/README.md b/utils/times/README.md index 66dbdc1..dc2a35e 100644 --- a/utils/times/README.md +++ b/utils/times/README.md @@ -70,8 +70,8 @@ |类型|名称|描述 |:--|:--|:-- -|`STRUCT`|[StateLine](#stateline)|状态时间线 -|`STRUCT`|[Period](#period)|表示一个时间段 +|`STRUCT`|[StateLine](#struct_StateLine)|状态时间线 +|`STRUCT`|[Period](#struct_Period)|表示一个时间段 @@ -399,6 +399,7 @@ func TestNewPeriodWindow(t *testing.T) { > 创建一个时间段,从 t 开始,持续 nanosecond 纳秒 *** + ### StateLine `STRUCT` 状态时间线 ```go @@ -486,6 +487,7 @@ type StateLine[State generic.Basic] struct { #### func (*StateLine) RangeReverse(handler func (index int, state State, t time.Time) bool) > 按照时间逆序遍历时间线 *** + ### Period `STRUCT` 表示一个时间段 ```go