1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-05 13:22:26 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
dudaodong
4848647918 add go.mod 2021-11-29 11:48:12 +08:00
dudaodong
45fc84d1f2 update readme file and remove go.mod 2021-11-29 11:47:36 +08:00

View File

@@ -5,7 +5,6 @@
</p>
<div align="center" style="text-align: center;">
</div>
English | [简体中文](./README_zh-CN.md)
@@ -53,7 +52,7 @@ func main() {
### API Documentation
#### 1. convertor contains some functions for data convertion.
#### 1. convertor contains some functions for data convertion
- Support conversion between commonly used data types.
- Usage: import "github.com/duke-git/lancet/cryptor"
@@ -91,7 +90,7 @@ func ToString(value interface{}) string //convert value to string
func StructToMap(value interface{}) (map[string]interface{}, error) //convert struct to map, only convert exported field, tag `json` should be set
```
#### 2. cryptor is for data encryption and decryption.
#### 2. cryptor is for data encryption and decryption
- Support md5, hmac, aes, des, ras.
- Usage: import "github.com/duke-git/lancet/cryptor"
@@ -284,7 +283,7 @@ func HttpPatch(url string, params ...interface{}) (*http.Response, error) //http
func ConvertMapToQueryString(param map[string]interface{}) string //convert map to url query string
```
#### 7. random is for rand string and int generation.
#### 7. random is for rand string and int generation
- Generate random string and int.
- Usage: import "github.com/duke-git/lancet/random".
@@ -336,7 +335,7 @@ func main() {
}
```
- Function list:
- Function list:
```go
func Contain(slice interface{}, value interface{}) bool //check if the value is in the slice or not
@@ -379,7 +378,7 @@ func main() {
}
```
- Function list:
- Function list:
```go
func After(s, char string) string //create substring in source string after position when char first appear