Skip to content

Commit aa05027

Browse files
committed
doc: update readme file
1 parent fabc348 commit aa05027

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ func main() {
8484
- [Cryptor](#user-content-cryptor)
8585
- [Datetime](#user-content-datetime)
8686
- [Datastructure](#user-content-datastructure)
87+
- [EventBus](#user-content-eventbus)
88+
- [Enum](#user-content-enum)
8789
- [Fileutil](#user-content-fileutil)
8890
- [Formatter](#user-content-formatter)
8991
- [Function](#user-content-function)
@@ -766,7 +768,7 @@ import "github.com/duke-git/lancet/v2/eventbus"
766768
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/eventbus.md#SetErrorHandler)]
767769
[[play](https://go.dev/play/p/gmB0gnFe5mc)]
768770

769-
<h3 id="eventbus"> 10. Package enum provides a simple enum implementation. &nbsp; &nbsp; &nbsp; &nbsp;<a href="#index">Index</a></h3>
771+
<h3 id="enum"> 10. Package enum provides a simple enum implementation. &nbsp; &nbsp; &nbsp; &nbsp;<a href="#index">Index</a></h3>
770772

771773
```go
772774
import "github.com/duke-git/lancet/v2/enum"
@@ -789,43 +791,43 @@ import "github.com/duke-git/lancet/v2/enum"
789791
- **<big>Valid</big>** : Checks if the enum item is valid. If a custom check function is provided, it will be used to validate the value.
790792
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Valid)]
791793
[[play](https://go.dev/play/p/pA3lYY2VSm3)]
792-
- **<big>MarshalJSON</big>** : Implementation of json.Marshaler interface.</p>
794+
- **<big>MarshalJSON</big>** : Implementation of json.Marshaler interface.
793795
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#MarshalJSON)]
794796
[[play](https://go.dev/play/p/zIZEdAnneB5)]
795-
- **<big>NewRegistry</big>** : Creates a new enum registry..</p>
797+
- **<big>NewRegistry</big>** : Creates a new enum registry.
796798
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#NewRegistry)]
797799
[[play](https://go.dev/play/p/ABEXsYfJKMo)]
798-
- **<big>Add</big>** : Adds enum items to the registry.</p>
800+
- **<big>Add</big>** : Adds enum items to the registry.
799801
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Add)]
800802
[[play](https://go.dev/play/p/ABEXsYfJKMo)]
801-
- **<big>Remove</big>** : Removes an enum item from the registry by its value.</p>
803+
- **<big>Remove</big>** : Removes an enum item from the registry by its value.
802804
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Remove)]
803805
[[play](https://go.dev/play/p/dSG84wQ3TuC)]
804-
- **<big>Update</big>** : Updates the name of an enum item in the registry by its value.</p>
806+
- **<big>Update</big>** : Updates the name of an enum item in the registry by its value.
805807
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Update)]
806808
[[play](https://go.dev/play/p/Ol0moT1J9Xl)]
807-
- **<big>GetByValue</big>** : Retrieves an enum item by its value.</p>
809+
- **<big>GetByValue</big>** : Retrieves an enum item by its value.
808810
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#GetByValue)]
809811
[[play](https://go.dev/play/p/niJ1U2KlE_m)]
810-
- **<big>GetByName</big>** : Retrieves an enum item by its name.</p>
812+
- **<big>GetByName</big>** : Retrieves an enum item by its name.
811813
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#GetByName)]
812814
[[play](https://go.dev/play/p/49ie_gpqH0m)]
813-
- **<big>Items</big>** : Returns a slice of all enum items in the registry.</p>
815+
- **<big>Items</big>** : Returns a slice of all enum items in the registry.
814816
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Items)]
815817
[[play](https://go.dev/play/p/lAJFAradbvQ)]
816818
- **<big>Contains</big>** : Checks if an enum item with the given value exists in the registry.</p>
817819
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Contains)]
818820
[[play](https://go.dev/play/p/_T-lPYkZn2j)]
819-
- **<big>Size</big>** : Returns the number of enum items in the registry.</p>
821+
- **<big>Size</big>** : Returns the number of enum items in the registry.
820822
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Size)]
821823
[[play](https://go.dev/play/p/TeDArWhlQe2)]
822-
- **<big>Range</big>** : Iterates over all enum items in the registry and applies the given function.</p>
824+
- **<big>Range</big>** : Iterates over all enum items in the registry and applies the given function.
823825
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Range)]
824826
[[play](https://go.dev/play/p/GPsZbQbefWN)]
825-
- **<big>SortedItems</big>** : Returns a slice of all enum items sorted by the given less function.</p>
827+
- **<big>SortedItems</big>** : Returns a slice of all enum items sorted by the given less function.
826828
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#SortedItems)]
827829
[[play](https://go.dev/play/p/tN9RE_m_WEI)]
828-
- **<big>Filter</big>** : Returns a slice of enum items that satisfy the given predicate function.</p>
830+
- **<big>Filter</big>** : Returns a slice of enum items that satisfy the given predicate function.
829831
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/enum.md#Filter)]
830832
[[play](https://go.dev/play/p/uTUpTdcyoCU)]
831833

README_zh-CN.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ func main() {
8383
- [Cryptor](#user-content-cryptor)
8484
- [Datetime](#user-content-datetime)
8585
- [Datastructure](#user-content-datastructure)
86+
- [EventBus](#user-content-eventbus)
87+
- [Enum](#user-content-enum)
8688
- [Fileutil](#user-content-fileutil)
8789
- [Formatter](#user-content-formatter)
8890
- [Function](#user-content-function)
@@ -776,7 +778,7 @@ import "github.com/duke-git/lancet/v2/eventbus"
776778
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/eventbus.md#SetErrorHandler)]
777779
[[play](https://go.dev/play/p/gmB0gnFe5mc)]
778780

779-
<h3 id="eventbus"> 10. Enum实现一个简单枚举工具包。. &nbsp; &nbsp; &nbsp; &nbsp;<a href="#index">Index</a></h3>
781+
<h3 id="enum"> 10. Enum实现一个简单枚举工具包。. &nbsp; &nbsp; &nbsp; &nbsp;<a href="#index">Index</a></h3>
780782

781783
```go
782784
import "github.com/duke-git/lancet/v2/enum"
@@ -799,43 +801,43 @@ import "github.com/duke-git/lancet/v2/enum"
799801
- **<big>Valid</big>** : 检查枚举项是否有效。如果提供了自定义检查函数,将使用该函数验证值。
800802
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Valid)]
801803
[[play](https://go.dev/play/p/pA3lYY2VSm3)]
802-
- **<big>MarshalJSON</big>** : 枚举项实现 json.Marshaler 接口。</p>
804+
- **<big>MarshalJSON</big>** : 枚举项实现 json.Marshaler 接口。
803805
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#MarshalJSON)]
804806
[[play](https://go.dev/play/p/zIZEdAnneB5)]
805-
- **<big>NewRegistry</big>** : Registry 定义了一个通用的枚举注册表结构体。</p>
807+
- **<big>NewRegistry</big>** : Registry 定义了一个通用的枚举注册表结构体。
806808
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#NewRegistry)]
807809
[[play](https://go.dev/play/p/ABEXsYfJKMo)]
808-
- **<big>Add</big>** : 向枚举注册表添加枚举项。</p>
810+
- **<big>Add</big>** : 向枚举注册表添加枚举项。
809811
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Add)]
810812
[[play](https://go.dev/play/p/ABEXsYfJKMo)]
811-
- **<big>Remove</big>** : 在枚举注册表中删除枚举项。</p>
813+
- **<big>Remove</big>** : 在枚举注册表中删除枚举项。
812814
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Remove)]
813815
[[play](https://go.dev/play/p/dSG84wQ3TuC)]
814-
- **<big>Update</big>** : 在枚举注册表中更新枚举项。</p>
816+
- **<big>Update</big>** : 在枚举注册表中更新枚举项。
815817
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Update)]
816818
[[play](https://go.dev/play/p/Ol0moT1J9Xl)]
817-
- **<big>GetByValue</big>** : 在枚举注册表中通过值获取枚举项。</p>
819+
- **<big>GetByValue</big>** : 在枚举注册表中通过值获取枚举项。
818820
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#GetByValue)]
819821
[[play](https://go.dev/play/p/niJ1U2KlE_m)]
820-
- **<big>GetByName</big>** : 在枚举注册表中通过名称获取枚举项。</p>
822+
- **<big>GetByName</big>** : 在枚举注册表中通过名称获取枚举项。
821823
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#GetByName)]
822824
[[play](https://go.dev/play/p/49ie_gpqH0m)]
823-
- **<big>Items</big>** : 返回枚举注册表中的枚举项。</p>
825+
- **<big>Items</big>** : 返回枚举注册表中的枚举项。
824826
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Items)]
825827
[[play](https://go.dev/play/p/lAJFAradbvQ)]
826-
- **<big>Contains</big>** : 检查注册表中是否存在具有给定值的枚举项。</p>
828+
- **<big>Contains</big>** : 检查注册表中是否存在具有给定值的枚举项。
827829
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Contains)]
828830
[[play](https://go.dev/play/p/_T-lPYkZn2j)]
829-
- **<big>Size</big>** : 返回注册表中枚举项的数目。</p>
831+
- **<big>Size</big>** : 返回注册表中枚举项的数目。
830832
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Size)]
831833
[[play](https://go.dev/play/p/TeDArWhlQe2)]
832834
- **<big>Range</big>** : 遍历注册表中的所有枚举项,并应用给定的函数。
833835
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Range)]
834836
[[play](https://go.dev/play/p/GPsZbQbefWN)]
835-
- **<big>SortedItems</big>** : 返回按给定比较函数排序的所有枚举项的切片。</p>
837+
- **<big>SortedItems</big>** : 返回按给定比较函数排序的所有枚举项的切片。
836838
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#SortedItems)]
837839
[[play](https://go.dev/play/p/tN9RE_m_WEI)]
838-
- **<big>Filter</big>** : 返回满足给定谓词函数的枚举项切片。</p>
840+
- **<big>Filter</big>** : 返回满足给定谓词函数的枚举项切片。
839841
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/enum.md#Filter)]
840842
[[play](https://go.dev/play/p/uTUpTdcyoCU)]
841843

0 commit comments

Comments
 (0)