Skip to content

Commit

Permalink
doc: update go doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fufuok committed Nov 6, 2024
1 parent ac783c1 commit 468922c
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
72 changes: 71 additions & 1 deletion DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import "github.com/fufuok/utils"
- [func Bigoom\(n, b \*big.Int\) \(float64, int\)](<#Bigoom>)
- [func CPUTicks\(\) int64](<#CPUTicks>)
- [func CallPath\(\) string](<#CallPath>)
- [func CheckDomain\(name string\) error](<#CheckDomain>)
- [func Comma\(v int64\) string](<#Comma>)
- [func Commaf\(v float64\) string](<#Commaf>)
- [func Commai\(v int\) string](<#Commai>)
Expand Down Expand Up @@ -68,7 +69,9 @@ import "github.com/fufuok/utils"
- [func FastRand64\(\) uint64](<#FastRand64>)
- [func FastRandn\(n uint32\) uint32](<#FastRandn>)
- [func FastRandu\(\) uint](<#FastRandu>)
- [func FirstString\(s, sep string, defaultStr ...string\) string](<#FirstString>)
- [func GetBytes\(v interface\{\}, defaultVal ...\[\]byte\) \[\]byte](<#GetBytes>)
- [func GetDomain\(name string\) string](<#GetDomain>)
- [func GetIPPort\(addr net.Addr\) \(ip net.IP, port int, err error\)](<#GetIPPort>)
- [func GetInt\(v interface\{\}, defaultInt ...int\) int](<#GetInt>)
- [func GetMonthDays\(t time.Time\) int](<#GetMonthDays>)
Expand Down Expand Up @@ -114,12 +117,15 @@ import "github.com/fufuok/utils"
- [func IsInternalIPv4\(ip net.IP\) bool](<#IsInternalIPv4>)
- [func IsInternalIPv4String\(ip string\) bool](<#IsInternalIPv4String>)
- [func IsLeapYear\(year int\) bool](<#IsLeapYear>)
- [func IsLetter\(s string\) bool](<#IsLetter>)
- [func IsLetterOrNumeric\(s string\) bool](<#IsLetterOrNumeric>)
- [func IsNumeric\(s string\) bool](<#IsNumeric>)
- [func IsPrivateIP\(ip net.IP\) bool](<#IsPrivateIP>)
- [func IsPrivateIPString\(ip string\) bool](<#IsPrivateIPString>)
- [func JoinBytes\(b ...\[\]byte\) \[\]byte](<#JoinBytes>)
- [func JoinString\(s ...string\) string](<#JoinString>)
- [func JoinStringBytes\(s ...string\) \[\]byte](<#JoinStringBytes>)
- [func LastString\(s, sep string, defaultStr ...string\) string](<#LastString>)
- [func LeftPad\(s, pad string, n int\) string](<#LeftPad>)
- [func LeftPadBytes\(b, pad \[\]byte, n int\) \[\]byte](<#LeftPadBytes>)
- [func Logn\(n, b float64\) float64](<#Logn>)
Expand Down Expand Up @@ -192,6 +198,7 @@ import "github.com/fufuok/utils"
- [func TrimRight\(s string, cutset byte\) string](<#TrimRight>)
- [func TrimRightBytes\(b \[\]byte, cutset byte\) \[\]byte](<#TrimRightBytes>)
- [func TrimSlice\(ss \[\]string\) \[\]string](<#TrimSlice>)
- [func TruncStr\(s string, maxLen int, suffix string\) string](<#TruncStr>)
- [func UUID\(\) \[\]byte](<#UUID>)
- [func UUIDShort\(\) string](<#UUIDShort>)
- [func UUIDSimple\(\) string](<#UUIDSimple>)
Expand Down Expand Up @@ -566,6 +573,15 @@ func CallPath() string

CallPath 运行时路径, 编译目录 假如: mklink E:\\tmp\\linkapp.exe D:\\Fufu\\Test\\abc\\app.exe 执行: E:\\tmp\\linkapp.exe CallPath: E:\\Go\\src\\github.com\\fufuok\\utils\\tmp\\osext

<a name="CheckDomain"></a>
## func CheckDomain

```go
func CheckDomain(name string) error
```

CheckDomain returns an error if the host name is not valid. See https://tools.ietf.org/html/rfc1034#section-3.5 and https://tools.ietf.org/html/rfc1123#section-2. Ref: chmike/domain

<a name="Comma"></a>
## func Comma

Expand Down Expand Up @@ -883,6 +899,15 @@ func FastRandu() uint



<a name="FirstString"></a>
## func FirstString

```go
func FirstString(s, sep string, defaultStr ...string) string
```

FirstString 获取文本内容第一个分隔符\(单字节: sep\[0\]\)前的内容

<a name="GetBytes"></a>
## func GetBytes

Expand All @@ -892,6 +917,15 @@ func GetBytes(v interface{}, defaultVal ...[]byte) []byte

GetBytes 先转为字符串再转为 \[\]byte, 可选指定默认值

<a name="GetDomain"></a>
## func GetDomain

```go
func GetDomain(name string) string
```

GetDomain 检查并返回清除前后空白的域名

<a name="GetIPPort"></a>
## func GetIPPort

Expand Down Expand Up @@ -1305,14 +1339,32 @@ func IsLeapYear(year int) bool

IsLeapYear 判断是否为闰年

<a name="IsLetter"></a>
## func IsLetter

```go
func IsLetter(s string) bool
```

IsLetter 检查字符串是否全是 ASCII 字母

<a name="IsLetterOrNumeric"></a>
## func IsLetterOrNumeric

```go
func IsLetterOrNumeric(s string) bool
```

IsLetterOrNumeric 检查字符串是否全是 ASCII 字母或数字

<a name="IsNumeric"></a>
## func IsNumeric

```go
func IsNumeric(s string) bool
```

IsNumeric 检查字符串是否全是数字: 0\-9
IsNumeric 检查字符串是否全是 ASCII 数字: 0\-9

<a name="IsPrivateIP"></a>
## func IsPrivateIP
Expand Down Expand Up @@ -1359,6 +1411,15 @@ func JoinStringBytes(s ...string) []byte

JoinStringBytes 拼接字符串, 返回 bytes from bytes.Join\(\)

<a name="LastString"></a>
## func LastString

```go
func LastString(s, sep string, defaultStr ...string) string
```

LastString 获取文本内容最后一个分隔符\(单字节: sep\[0\]\)后的内容

<a name="LeftPad"></a>
## func LeftPad

Expand Down Expand Up @@ -2011,6 +2072,15 @@ func TrimSlice(ss []string) []string

TrimSlice 清除 slice 中各元素的空白, 并删除空白项 注意: 原切片将被修改

<a name="TruncStr"></a>
## func TruncStr

```go
func TruncStr(s string, maxLen int, suffix string) string
```

TruncStr 截断字符串

<a name="UUID"></a>
## func UUID

Expand Down
20 changes: 20 additions & 0 deletions xfile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "github.com/fufuok/utils/xfile"
- [Variables](<#variables>)
- [func CopyDir\(srcDir, dstDir string\) error](<#CopyDir>)
- [func CopyFile\(srcFile, dstFile string\) error](<#CopyFile>)
- [func HeadLines\(filename string, num int\) \(\[\]string, error\)](<#HeadLines>)
- [func IsDir\(s string\) bool](<#IsDir>)
- [func IsExist\(s string\) bool](<#IsExist>)
- [func IsFile\(s string\) bool](<#IsFile>)
Expand All @@ -20,6 +21,7 @@ import "github.com/fufuok/utils/xfile"
- [func ReadLines\(filename string\) \(\[\]string, error\)](<#ReadLines>)
- [func ReadLinesOffsetN\(filename string, offset uint, n int\) \(\[\]string, error\)](<#ReadLinesOffsetN>)
- [func ResetDir\(dirPath string\) error](<#ResetDir>)
- [func TailLines\(filename string, num int, cleanLine ...bool\) \(\[\]string, error\)](<#TailLines>)
- [func UnzipDir\(zipFile, dstDir string\) error](<#UnzipDir>)
- [func UnzipFile\(zipFile \*zip.File, dstFile string\) error](<#UnzipFile>)
- [func ZipDir\(srcDir, zipFilePath string\) error](<#ZipDir>)
Expand Down Expand Up @@ -76,6 +78,15 @@ func CopyFile(srcFile, dstFile string) error

CopyFile 文件拷贝

<a name="HeadLines"></a>
## func HeadLines

```go
func HeadLines(filename string, num int) ([]string, error)
```

HeadLines 读取文件头部 N 行

<a name="IsDir"></a>
## func IsDir

Expand Down Expand Up @@ -148,6 +159,15 @@ func ResetDir(dirPath string) error

ResetDir 清除并重建空目录

<a name="TailLines"></a>
## func TailLines

```go
func TailLines(filename string, num int, cleanLine ...bool) ([]string, error)
```

TailLines 返回文件最后 N 行

<a name="UnzipDir"></a>
## func UnzipDir

Expand Down

0 comments on commit 468922c

Please sign in to comment.