https://github.com/wgrape/golib
A simple and easy-to-use library in go / 一个简单易用的Go语言封装库
https://github.com/wgrape/golib
go golang library
Last synced: about 1 year ago
JSON representation
A simple and easy-to-use library in go / 一个简单易用的Go语言封装库
- Host: GitHub
- URL: https://github.com/wgrape/golib
- Owner: WGrape
- License: mit
- Created: 2022-07-04T05:20:52.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-29T15:21:23.000Z (over 2 years ago)
- Last Synced: 2025-04-24T00:03:58.228Z (about 1 year ago)
- Topics: go, golang, library
- Language: Go
- Homepage:
- Size: 116 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Background
When using the Go language, you may feel that time calculation, file processing, array operations, etc. often require a lot of time and code to complete, which is very inconvenient.
In order to solve this problem, all common complex underlying operations and business operations can be encapsulated into simple and easy-to-use APIs, and the most important thing is that these APIs are unified and standard, and conform to the Go interface specification.
So the golib project came into being.
## Download
Using ```go get``` or ```go mod``` the two ways to download this project. It is recommended to download the latest version.
### go get
```bash
go get github.com/WGrape/golib@latest
```
### go mod
If you put the word latest in place of the tag in the ```go.mod``` file it will get changed to the latest tag the modules.
```mod
module XXX
go 1.16
require (
github.com/WGrape/golib latest
)
```
## Usage
After the download and import are successful, you can call the ```golib package``` as follows.
> The code is from [matching](https://github.com/WGrape/matching/blob/main/pkg/strategy/strategy.go) project.
```go
import "github.com/WGrape/golib/permutation"
// getCombinationList get the combination list of properties
func (strategy *UseStrategy) getCombinationList(propertyList []string) []string {
return permutation.GetCombinationsWithImplode(propertyList, ";")
}
```
## Contributing
Since this project consists of individual ```package```, there is almost no code reading cost. If you have better ideas, you are very welcome to join in and contribute. Please refer to [Contribution Documentation](.github/CONTRIBUTING.md) on how to contribute.

## Package list
| package | description | api |
|-----------------|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| safego | Package safego provides a series of security behaviors. | [document](https://pkg.go.dev/github.com/WGrape/golib/safego) |
| permutation | Package permutation provides many algorithms about permutation and combination. | [document](https://pkg.go.dev/github.com/WGrape/golib/permutation) |
| http | The http package provides efficient and high-performance network operations. | [document](https://pkg.go.dev/github.com/WGrape/golib/http) |
| redis | Package redis provides advanced operations, such as ```Cache Penetration, Cache Breakdown, Cache Avalanche```. | [document](https://pkg.go.dev/github.com/WGrape/golib/redis) |
| desensitization | Package desensitization provides data desensitization support. | [document](https://pkg.go.dev/github.com/WGrape/golib/desensitization) |
| time | Package time provides functionality for measuring and displaying time more efficiently. | [document](https://pkg.go.dev/github.com/WGrape/golib/time) |
| array | Package array provides functionality for measuring and displaying array more efficiently. | [document](https://pkg.go.dev/github.com/WGrape/golib/array) |
| binary | Package binary provides some operations of binary number and decimal number. | [document](https://pkg.go.dev/github.com/WGrape/golib/binary) |
| convert | Package convert provides simpler conversion between int, float, and string. | [document](https://pkg.go.dev/github.com/WGrape/golib/convert) |
| set | Package set provides simpler set operations. | [document](https://pkg.go.dev/github.com/WGrape/golib/set) |
| rand | Package rand provides some random operations. | [document](https://pkg.go.dev/github.com/WGrape/golib/rand) |
| math | Package math provides simpler math operations. | [document](https://pkg.go.dev/github.com/WGrape/golib/math) |
| system | Package system provides an interface to interact with the linux system. | [document](https://pkg.go.dev/github.com/WGrape/golib/system) |
| string | Package string provides an interface to process string in the simpler way. | [document](https://pkg.go.dev/github.com/WGrape/golib/string) |
| slice | Package slice provides an interface to process slice in the simpler way. | [document](https://pkg.go.dev/github.com/WGrape/golib/slice) |
| frontend | Package frontend provides an interface to work with front-end colleagues in the simpler way. | [document](https://pkg.go.dev/github.com/WGrape/golib/frontend) |