docs: 优化文档展示,适配部分无目录文档,适配非结构体的类型定义,增加测试用例文档

This commit is contained in:
kercylan
2024-01-14 18:32:44 +08:00
parent 83beeb43ce
commit b2fdaa2ae6
80 changed files with 9523 additions and 1473 deletions

View File

@@ -1,134 +1,163 @@
# Generic
[![Go doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/kercylan98/minotaur/generic)
![](https://img.shields.io/badge/Email-kercylan@gmail.com-green.svg?style=flat)
generic 目的在于提供一组基于泛型的用于处理通用功能的函数和数据结构。该包旨在简化通用功能的实现,并提供一致的接口和易于使用的功能。
主要特性:
- 通用功能generic 包支持处理各种通用功能,如数据结构操作、算法实现和常用工具等。您可以使用这些功能来解决各种通用问题,并提高代码的复用性和可维护性。
[![Go doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/kercylan98/minotaur/generic)
![](https://img.shields.io/badge/Email-kercylan@gmail.com-green.svg?style=flat)
## 目录
列出了该 `package` 下所有的函数,可通过目录进行快捷跳转 ❤️
## 目录导航
列出了该 `package` 下所有的函数及类型定义,可通过目录导航进行快捷跳转 ❤️
<details>
<summary>展开 / 折叠目录</summary
<summary>展开 / 折叠目录导航</summary>
> 包级函数定义
|函数|描述
|函数名称|描述
|:--|:--
|[IsNil](#IsNil)|检查指定的值是否为 nil
|[IsAllNil](#IsAllNil)|检查指定的值是否全部为 nil
|[IsHasNil](#IsHasNil)|检查指定的值是否存在 nil
> 结构体定义
> 类型定义
|结构体|描述
|:--|:--
|[IdR](#idr)|暂无描述...
|[IDR](#idr)|暂无描述...
|[IdW](#idw)|暂无描述...
|[IDW](#idw)|暂无描述...
|[IdR2W](#idr2w)|暂无描述...
|[IDR2W](#idr2w)|暂无描述...
|[Ordered](#ordered)|可排序类型
|[Number](#number)|数字类型
|[SignedNumber](#signednumber)|有符号数字类型
|[Integer](#integer)|整数类型
|[Signed](#signed)|有符号整数类型
|[Unsigned](#unsigned)|无符号整数类型
|[UnsignedNumber](#unsignednumber)|无符号数字类型
|[Float](#float)|浮点类型
|[Basic](#basic)|基本类型
|类型|名称|描述
|:--|:--|:--
|`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)|基本类型
</details>
***
## 详情信息
#### func IsNil(v V) bool
<span id="IsNil"></span>
> 检查指定的值是否为 nil
***
#### func IsAllNil(v ...V) bool
<span id="IsAllNil"></span>
> 检查指定的值是否全部为 nil
***
#### func IsHasNil(v ...V) bool
<span id="IsHasNil"></span>
> 检查指定的值是否存在 nil
***
### IdR
### IdR `INTERFACE`
```go
type IdR[ID comparable] struct{}
type IdR[ID comparable] interface {
GetId() ID
}
```
### IDR
### IDR `INTERFACE`
```go
type IDR[ID comparable] struct{}
type IDR[ID comparable] interface {
GetID() ID
}
```
### IdW
### IdW `INTERFACE`
```go
type IdW[ID comparable] struct{}
type IdW[ID comparable] interface {
SetId(id ID)
}
```
### IDW
### IDW `INTERFACE`
```go
type IDW[ID comparable] struct{}
type IDW[ID comparable] interface {
SetID(id ID)
}
```
### IdR2W
### IdR2W `INTERFACE`
```go
type IdR2W[ID comparable] struct{}
type IdR2W[ID comparable] interface {
IdR[ID]
IdW[ID]
}
```
### IDR2W
### IDR2W `INTERFACE`
```go
type IDR2W[ID comparable] struct{}
type IDR2W[ID comparable] interface {
IDR[ID]
IDW[ID]
}
```
### Ordered
### Ordered `INTERFACE`
可排序类型
```go
type Ordered struct{}
type Ordered interface {
}
```
### Number
### Number `INTERFACE`
数字类型
```go
type Number struct{}
type Number interface {
}
```
### SignedNumber
### SignedNumber `INTERFACE`
有符号数字类型
```go
type SignedNumber struct{}
type SignedNumber interface {
}
```
### Integer
### Integer `INTERFACE`
整数类型
```go
type Integer struct{}
type Integer interface {
}
```
### Signed
### Signed `INTERFACE`
有符号整数类型
```go
type Signed struct{}
type Signed interface {
}
```
### Unsigned
### Unsigned `INTERFACE`
无符号整数类型
```go
type Unsigned struct{}
type Unsigned interface {
}
```
### UnsignedNumber
### UnsignedNumber `INTERFACE`
无符号数字类型
```go
type UnsignedNumber struct{}
type UnsignedNumber interface {
}
```
### Float
### Float `INTERFACE`
浮点类型
```go
type Float struct{}
type Float interface {
}
```
### Basic
### Basic `INTERFACE`
基本类型
```go
type Basic struct{}
type Basic interface {
}
```