forked from forgejo/forgejo
upgrade levelqueue to 0.1.0 (#9192)
This commit is contained in:
parent
ef9a0370ca
commit
3bdce82ce9
14 changed files with 142 additions and 40 deletions
28
vendor/gitea.com/lunny/levelqueue/README.md
generated
vendored
Normal file
28
vendor/gitea.com/lunny/levelqueue/README.md
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# levelqueue
|
||||
|
||||
Level queue is a simple queue golang library base on go-leveldb.
|
||||
|
||||
[](https://drone.gitea.com/lunny/levelqueue) [](http://gocover.io/gitea.com/lunny/levelqueue)
|
||||
[](https://goreportcard.com/report/gitea.com/lunny/levelqueue)
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
go get gitea.com/lunny/levelqueue
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```Go
|
||||
queue, err := levelqueue.Open("./queue")
|
||||
|
||||
err = queue.RPush([]byte("test"))
|
||||
|
||||
// pop an element from left of the queue
|
||||
data, err = queue.LPop()
|
||||
|
||||
// if handle success, element will be pop, otherwise it will be keep
|
||||
queue.LHandle(func(dt []byte) error{
|
||||
return nil
|
||||
})
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue