mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-12 16:52:29 +08:00
doc: update link in readme
This commit is contained in:
53
README.md
53
README.md
@@ -86,7 +86,6 @@ func main() {
|
||||
- [Fileutil](#Fileutil)
|
||||
- [Formatter](#Formatter)
|
||||
- [Function](#Function)
|
||||
- [Iterator](#Iterator)
|
||||
- [Maputil](#Maputil)
|
||||
- [Mathutil](#Mathutil)
|
||||
- [Netutil](#Netutil)
|
||||
@@ -102,9 +101,7 @@ func main() {
|
||||
- [Validator](#Validator)
|
||||
- [Xerror](#Xerror)
|
||||
|
||||
<h3 id="Algorithm"> 1. Algorithm package implements some basic algorithm. eg. sort, search. [index](#index) </h3>
|
||||
|
||||
#### Usage:
|
||||
<h3 id="Algorithm"> 1. Algorithm package implements some basic algorithm. eg. sort, search. <a href="#index">index</span> </h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/algorithm"
|
||||
@@ -149,7 +146,7 @@ import "github.com/duke-git/lancet/v2/algorithm"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#LRUCache)]
|
||||
[[play](https://go.dev/play/p/-EZjgOURufP)]
|
||||
|
||||
### <span id="Compare"> 2. Compare package provides a lightweight comparison function on any type.</span> [index](#index)
|
||||
<h3 id="Compare"> 2. Compare package provides a lightweight comparison function on any type. <a href="#index">index</span> </h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/compare"
|
||||
@@ -176,7 +173,7 @@ import "github.com/duke-git/lancet/v2/compare"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#GreaterOrEqual)]
|
||||
[[play](https://go.dev/play/p/vx8mP0U8DFk)]
|
||||
|
||||
### <span id="Concurrency">3. Concurrency package contain some functions to support concurrent programming. eg, goroutine, channel, async.</span> [index](#index)
|
||||
<h3 id="Concurrency"> 3. Concurrency package contain some functions to support concurrent programming. eg, goroutine, channel, async. <a href="#index">index</span> </h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/concurrency"
|
||||
@@ -215,7 +212,7 @@ import "github.com/duke-git/lancet/v2/concurrency"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#Tee)]
|
||||
[[play](https://go.dev/play/p/3TQPKnCirrP)]
|
||||
|
||||
### <span id="Condition">4. Condition package contains some functions for conditional judgment. eg. And, Or, TernaryOperator...</span> [index](#index)
|
||||
<h3 id="Condition"> 4. Condition package contains some functions for conditional judgment. eg. And, Or, TernaryOperator... <a href="#index">index</span> </h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/condition"
|
||||
@@ -248,7 +245,7 @@ import "github.com/duke-git/lancet/v2/condition"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#TernaryOperator)]
|
||||
[[play](https://go.dev/play/p/ElllPZY0guT)]
|
||||
|
||||
### <span id="Convertor">5. Convertor package contains some functions for data convertion.</span> [index](#index)
|
||||
<h3 id="Convertor"> 5. Convertor package contains some functions for data convertion. <a href="#index">index</span> </h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/convertor"
|
||||
@@ -320,7 +317,7 @@ import "github.com/duke-git/lancet/v2/convertor"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#GbkToUtf8)]
|
||||
[[play](https://go.dev/play/p/OphmHCN_9u8)]
|
||||
|
||||
### <span id="Cryptor">6. Cryptor package is for data encryption and decryption.</span> [index](#index)
|
||||
<h3 id="Cryptor"> 6. Cryptor package is for data encryption and decryption.</span> <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/cryptor"
|
||||
@@ -424,7 +421,7 @@ import "github.com/duke-git/lancet/v2/cryptor"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#RsaDecrypt)]
|
||||
[[play](https://go.dev/play/p/uef0q1fz53I)]
|
||||
|
||||
### <span id="Datetime">7. Datetime package supports date and time format and compare.</span> [index](#index)
|
||||
<h3 id="Datetime"> 7. Datetime package supports date and time format and compare. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/datetime"
|
||||
@@ -538,7 +535,7 @@ import "github.com/duke-git/lancet/v2/datetime"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#IsWeekend)]
|
||||
[[play](https://go.dev/play/p/cupRM5aZOIY)]
|
||||
|
||||
### <span id="Datastructure">8. Datastructure package constains some common data structure. eg. list, linklist, stack, queue, set, tree, graph.</span> [index](#index)
|
||||
<h3 id="Datastructure"> 8. Datastructure package constains some common data structure. eg. list, linklist, stack, queue, set, tree, graph. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import list "github.com/duke-git/lancet/v2/datastructure/list"
|
||||
@@ -570,7 +567,7 @@ import hashmap "github.com/duke-git/lancet/v2/datastructure/hashmap"
|
||||
- **<big>Hashmap</big>** : hash map structure.
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/hashmap.md)]
|
||||
|
||||
### <span id="Fileutil">9. Fileutil package implements some basic functions for file operations.</span> [index](#index)
|
||||
<h3 id="Fileutil"> 9. Fileutil package implements some basic functions for file operations. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/fileutil"
|
||||
@@ -653,7 +650,7 @@ import "github.com/duke-git/lancet/v2/fileutil"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#WriteStringToFile)]
|
||||
[[play](https://go.dev/play/p/GhLS6d8lH_g)]
|
||||
|
||||
### <span id="Formatter">10. Formatter contains some functions for data formatting.</span> [index](#index)
|
||||
<h3 id="Formatter"> 10. Formatter contains some functions for data formatting. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/formatter"
|
||||
@@ -683,7 +680,7 @@ import "github.com/duke-git/lancet/v2/formatter"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#ParseBinaryBytes)]
|
||||
[[play](https://go.dev/play/p/69v1tTT62x8)]
|
||||
|
||||
### <span id="Function">11. Function package can control the flow of function execution and support part of functional programming.</span> [index](#index)
|
||||
<h3 id="Function"> 11. Function package can control the flow of function execution and support part of functional programming. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/function"
|
||||
@@ -719,7 +716,7 @@ import "github.com/duke-git/lancet/v2/function"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Watcher)]
|
||||
[[play](https://go.dev/play/p/l2yrOpCLd1I)]
|
||||
|
||||
### <span id="Maputil">12. Maputil package includes some functions to manipulate map.</span> [index](#index)
|
||||
<h3 id="Maputil"> 12. Maputil package includes some functions to manipulate map. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/maputil"
|
||||
@@ -791,7 +788,7 @@ import "github.com/duke-git/lancet/v2/maputil"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#IsDisjoint)]
|
||||
[[play](https://go.dev/play/p/N9qgYg_Ho6f)]
|
||||
|
||||
### <span id="Mathutil">13. Mathutil package implements some functions for math calculation.</span> [index](#index)
|
||||
<h3 id="Mathutil"> 13. Mathutil package implements some functions for math calculation. <a href="#index">index</span></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/mathutil"
|
||||
@@ -872,7 +869,7 @@ import "github.com/duke-git/lancet/v2/mathutil"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Sum)]
|
||||
[[play](https://go.dev/play/p/1To2ImAMJA7)]
|
||||
|
||||
### <span id="Netutil">14. Netutil package contains functions to get net information and send http request.</span> [index](#index)
|
||||
<h3 id="Netutil"> 14. Netutil package contains functions to get net information and send http request. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/netutil"
|
||||
@@ -945,7 +942,7 @@ import "github.com/duke-git/lancet/v2/netutil"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#IsTelnetConnected)]
|
||||
[[play](https://go.dev/play/p/yiLCGtQv_ZG)]
|
||||
|
||||
### <span id="Pointer">15. Pointer package contains some util functions to operate go pointer.</span> [index](#index)
|
||||
<h3 id="Pointer"> 15. Pointer package contains some util functions to operate go pointer. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/pointer"
|
||||
@@ -963,7 +960,7 @@ import "github.com/duke-git/lancet/v2/pointer"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer.md#Unwrap)]
|
||||
[[play](https://go.dev/play/p/cgeu3g7cjWb)]
|
||||
|
||||
### <span id="Random">16. Random package implements some basic functions to generate random int and string.</span> [index](#index)
|
||||
<h3 id="Random"> 16. Random package implements some basic functions to generate random int and string. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/random"
|
||||
@@ -999,7 +996,7 @@ import "github.com/duke-git/lancet/v2/random"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandUniqueIntSlice)]
|
||||
[[play](https://go.dev/play/p/uBkRSOz73Ec)]
|
||||
|
||||
### <span id="Retry">17. Retry package is for executing a function repeatedly until it was successful or canceled by the context.</span> [index](#index)
|
||||
<h3 id="Retry"> 17. Retry package is for executing a function repeatedly until it was successful or canceled by the context. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/retry"
|
||||
@@ -1023,7 +1020,7 @@ import "github.com/duke-git/lancet/v2/retry"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/retry.md#RetryTimes)]
|
||||
[[play](https://go.dev/play/p/ssfVeU2SwLO)]
|
||||
|
||||
### <span id="Slice">18. Slice contains some functions to manipulate slice.</span> [index](#index)
|
||||
<h3 id="Slice"> 18. Slice contains some functions to manipulate slice. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/slice"
|
||||
@@ -1236,7 +1233,7 @@ import "github.com/duke-git/lancet/v2/slice"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#KeyBy)]
|
||||
[[play](https://go.dev/play/p/uXod2LWD1Kg)]
|
||||
|
||||
### <span id="Stream">19. Stream package implements a sequence of elements supporting sequential and operations. this package is an experiment to explore if stream in go can work as the way java does. its function is very limited.</span> [index](#index)
|
||||
<h3 id="Stream"> 19. Stream package implements a sequence of elements supporting sequential and operations. this package is an experiment to explore if stream in go can work as the way java does. its function is very limited. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/stream"
|
||||
@@ -1323,7 +1320,7 @@ import "github.com/duke-git/lancet/v2/stream"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#ToSlice)]
|
||||
[[play](https://go.dev/play/p/jI6_iZZuVFE)]
|
||||
|
||||
### <span id="Structs">20. Structs package provides several high level functions to manipulate struct, tag, and field.</span> [index](#index)
|
||||
<h3 id="Structs"> 20. Structs package provides several high level functions to manipulate struct, tag, and field. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/structs"
|
||||
@@ -1356,7 +1353,7 @@ import "github.com/duke-git/lancet/v2/structs"
|
||||
- **<big>IsSlice</big>** : check if the field is a slice
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#IsSlice)]
|
||||
|
||||
### <span id="Strutil">21. Strutil package contains some functions to manipulate string.</span> [index](#index)
|
||||
<h3 id="Strutil"> 21. Strutil package contains some functions to manipulate string. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/strutil"
|
||||
@@ -1474,7 +1471,7 @@ import "github.com/duke-git/lancet/v2/strutil"
|
||||
- **<big>RemoveWhiteSpace</big>** : remove whitespace characters from a string.
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#RemoveWhiteSpace)]
|
||||
|
||||
### <span id="System">22. System package contain some functions about os, runtime, shell command.</span> [index](#index)
|
||||
<h3 id="System"> 22. System package contain some functions about os, runtime, shell command. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/system"
|
||||
@@ -1510,7 +1507,7 @@ import "github.com/duke-git/lancet/v2/system"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#GetOsBits)]
|
||||
[[play](https://go.dev/play/p/ml-_XH3gJbW)]
|
||||
|
||||
### <span id="Tuple">23. Tuple package implements tuple data type and some operations on it.</span> [index](#index)
|
||||
<h3 id="Tuple"> 23. Tuple package implements tuple data type and some operations on it. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/tuple"
|
||||
@@ -1591,7 +1588,7 @@ import "github.com/duke-git/lancet/v2/tuple"
|
||||
- **<big>Unzip10</big>** : create a group of slice from a slice of Tuple10.
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip10)]
|
||||
|
||||
### <span id="Validator">24. Validator package contains some functions for data validation.</span> [index](#index)
|
||||
<h3 id="Validator"> 24. Validator package contains some functions for data validation. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/validator"
|
||||
@@ -1699,7 +1696,7 @@ import "github.com/duke-git/lancet/v2/validator"
|
||||
[[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsPrintable)]
|
||||
[[play](https://go.dev/play/p/Pe1FE2gdtTP)]
|
||||
|
||||
### <span id="Xerror">25. xerror package implements helpers for errors.</span> [index](#index)
|
||||
<h3 id="Xerror"> 25. Xerror package implements helpers for errors. <a href="#index">index</a></h3>
|
||||
|
||||
```go
|
||||
import "github.com/duke-git/lancet/v2/xerror"
|
||||
|
||||
Reference in New Issue
Block a user