Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update some readme and re-generate readme docs
- Loading branch information
Showing
5 changed files
with
114 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Bytes Util | ||
|
||
Provide some commonly bytes util functions. | ||
|
||
## Install | ||
|
||
```shell | ||
go get github.com/gookit/goutil/byteutil | ||
``` | ||
|
||
## Go docs | ||
|
||
- [Go docs](https://pkg.go.dev/github.com/gookit/goutil/byteutil) | ||
|
||
## Functions API | ||
|
||
```go | ||
var HexEncoder = NewStdEncoder(func(src []byte) []byte { ... }, func(src []byte) ([]byte, error) { ... }) ... | ||
func Md5(src any) []byte | ||
type Buffer struct{ ... } | ||
func NewBuffer() *Buffer | ||
type BytesEncoder interface{ ... } | ||
type ChanPool struct{ ... } | ||
func NewChanPool(maxSize int, width int, capWidth int) *ChanPool | ||
type StdEncoder struct{ ... } | ||
func NewStdEncoder(encFn func(src []byte) []byte, decFn func(src []byte) ([]byte, error)) *StdEncoder | ||
``` | ||
|
||
## Code Check & Testing | ||
|
||
```bash | ||
gofmt -w -l ./ | ||
golint ./... | ||
``` | ||
|
||
**Testing**: | ||
|
||
```shell | ||
go test -v ./byteutil/... | ||
``` | ||
|
||
**Test limit by regexp**: | ||
|
||
```shell | ||
go test -v -run ^TestSetByKeys ./byteutil/... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters