Skip to content

Commit

Permalink
Update api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 19, 2024
1 parent 3ec08fe commit 5668487
Show file tree
Hide file tree
Showing 13 changed files with 525 additions and 128 deletions.
76 changes: 70 additions & 6 deletions docs/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| [cli.Bool](#bool) |Bool 获取对应名称的命令行参数,并将其转换为 bool 类型返回 |
| [cli.Double](#double) |Float 获取对应名称的命令行参数,并将其转换为 float 类型返回 |
| [cli.File](#file) |File 获取对应名称的命令行参数,根据其传入的值读取其对应文件内容并返回 []byte 类型 |
| [cli.FileNames](#filenames) |FileNames 获取对应名称的命令行参数,获得选中的所有文件路径,并返回 []string 类型 |
| [cli.FileOrContent](#fileorcontent) |FileOrContent 获取对应名称的命令行参数 根据其传入的值尝试读取其对应文件内容,如果无法读取则直接返回,最后返回 []byte 类型 |
| [cli.Float](#float) |Float 获取对应名称的命令行参数,并将其转换为 float 类型返回 |
| [cli.HTTPPacket](#httppacket) |String 获取对应名称的命令行参数,并将其转换为 string 类型返回 |
Expand All @@ -17,8 +18,8 @@
| [cli.LineDict](#linedict) |LineDict 获取对应名称的命令行参数 根据其传入的值尝试读取其对应文件内容,如果无法读取则作为字符串,最后根据换行符切割,返回 []string 类型 |
| [cli.Net](#net) |Hosts 获取对应名称的命令行参数,根据","切割并尝试解析CIDR网段并返回 []string 类型 |
| [cli.Network](#network) |Hosts 获取对应名称的命令行参数,根据","切割并尝试解析CIDR网段并返回 []string 类型 |
| [cli.Port](#port) ||
| [cli.Ports](#ports) ||
| [cli.Port](#port) |Ports 获取对应名称的命令行参数,根据","与"-"切割并尝试解析端口并返回 []int 类型 |
| [cli.Ports](#ports) |Ports 获取对应名称的命令行参数,根据","与"-"切割并尝试解析端口并返回 []int 类型 |
| [cli.SetCliName](#setcliname) |SetCliName 设置此命令行程序的名称 这会在命令行输入 --help 或执行`cli.check()`后参数非法时显示 |
| [cli.SetDoc](#setdoc) |SetDoc 设置此命令行程序的文档 这会在命令行输入 --help 或执行`cli.check()`后参数非法时显示 |
| [cli.String](#string) |String 获取对应名称的命令行参数,并将其转换为 string 类型返回 |
Expand Down Expand Up @@ -136,6 +137,34 @@ file = cli.File("file")
| r1 | `[]byte` | |
### FileNames
#### 详细描述
FileNames 获取对应名称的命令行参数,获得选中的所有文件路径,并返回 []string 类型
Example:
```
file = cli.FileNames("file")
// --file /etc/passwd,/etc/hosts 则 file 为 ["/etc/passwd", "/etc/hosts"]
```
#### 定义
`FileNames(name string, opts ...SetCliExtraParam) []string`
#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| name | `string` | |
| opts | `...SetCliExtraParam` | |
#### 返回值
|返回值(顺序)|返回值类型|返回值解释|
|:-----------|:---------- |:-----------|
| r1 | `[]string` | |
### FileOrContent
#### 详细描述
Expand Down Expand Up @@ -443,6 +472,13 @@ hosts = cli.Hosts("hosts")
### Port

#### 详细描述
Ports 获取对应名称的命令行参数,根据","与"-"切割并尝试解析端口并返回 []int 类型

Example:
```
ports = cli.Ports("ports")
// --ports 10086-10088,23333 则 ports 为 [10086, 10087, 10088, 23333]
```


#### 定义
Expand All @@ -464,6 +500,13 @@ hosts = cli.Hosts("hosts")
### Ports

#### 详细描述
Ports 获取对应名称的命令行参数,根据","与"-"切割并尝试解析端口并返回 []int 类型

Example:
```
ports = cli.Ports("ports")
// --ports 10086-10088,23333 则 ports 为 [10086, 10087, 10088, 23333]
```


#### 定义
Expand Down Expand Up @@ -767,7 +810,12 @@ cli.help()

#### 定义

`setCliGroup()`
`setCliGroup(group string)`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| group | `string` | |


### setDefault
Expand Down Expand Up @@ -831,7 +879,12 @@ cli.String("target", cli.SetHelp("target host or ip"))

#### 定义

`setMultipleSelect()`
`setMultipleSelect(multiSelect bool)`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| multiSelect | `bool` | |


### setRequired
Expand Down Expand Up @@ -867,7 +920,13 @@ cli.String("target", cli.SetRequired(true))

#### 定义

`setSelectOption()`
`setSelectOption(name string, value string)`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| name | `string` | |
| value | `string` | |


### setVerboseName
Expand All @@ -877,6 +936,11 @@ cli.String("target", cli.SetRequired(true))

#### 定义

`setVerboseName()`
`setVerboseName(verboseName string)`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| verboseName | `string` | |


16 changes: 14 additions & 2 deletions docs/api/codec.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
| [codec.RC4Decrypt](#rc4decrypt) ||
| [codec.RC4Encrypt](#rc4encrypt) ||
| [codec.RSADecryptWithOAEP](#rsadecryptwithoaep) ||
| [codec.RSADecryptWithPKCS1v15](#rsadecryptwithpkcs1v15) ||
| [codec.RSADecryptWithPKCS1v15](#rsadecryptwithpkcs1v15) |DecryptWithPkcs1v15 将PEM格式的私钥与密文进行PKCS1v15解密,返回明文与错误 |
| [codec.RSAEncryptWithOAEP](#rsaencryptwithoaep) ||
| [codec.RSAEncryptWithPKCS1v15](#rsaencryptwithpkcs1v15) ||
| [codec.RSAEncryptWithPKCS1v15](#rsaencryptwithpkcs1v15) |EncryptWithPkcs1v15 将PEM格式的公钥与数据进行PKCS1v15加密,返回密文与错误 |
| [codec.Sha1](#sha1) ||
| [codec.Sha224](#sha224) ||
| [codec.Sha256](#sha256) ||
Expand Down Expand Up @@ -1749,6 +1749,12 @@ replacing special characters (including /) with %XX sequences as needed.
### RSADecryptWithPKCS1v15

#### 详细描述
DecryptWithPkcs1v15 将PEM格式的私钥与密文进行PKCS1v15解密,返回明文与错误

Example:
```
dec, err := tls.DecryptWithPkcs1v15(pemBytes, enc)
```


#### 定义
Expand Down Expand Up @@ -1793,6 +1799,12 @@ replacing special characters (including /) with %XX sequences as needed.
### RSAEncryptWithPKCS1v15

#### 详细描述
EncryptWithPkcs1v15 将PEM格式的公钥与数据进行PKCS1v15加密,返回密文与错误

Example:
```
enc, err := tls.EncryptWithPkcs1v15(pemBytes, "hello")
```


#### 定义
Expand Down
21 changes: 21 additions & 0 deletions docs/api/fuzz.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| [fuzz.WithDelay](#withdelay) ||
| [fuzz.WithNamingContext](#withnamingcontext) ||
| [fuzz.WithTimeOut](#withtimeout) ||
| [fuzz.context](#context) ||
| [fuzz.https](#https) ||
| [fuzz.proxy](#proxy) ||

Expand Down Expand Up @@ -380,6 +381,26 @@ fuzz
| r1 | `HttpPoolConfigOption` | |


### context

#### 详细描述


#### 定义

`context(ctx context.Context) BuildFuzzHTTPRequestOption`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| ctx | `context.Context` | |

#### 返回值
|返回值(顺序)|返回值类型|返回值解释|
|:-----------|:---------- |:-----------|
| r1 | `BuildFuzzHTTPRequestOption` | |


### https

#### 详细描述
Expand Down
Loading

0 comments on commit 5668487

Please sign in to comment.