mq

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

使用golang实现的轻量级mq

支持功能

  • 创建队列 CreateMq(mq string)
  • 删除队列 DeleteMq(mq string)
  • 清空队列 Drop(mq string)
  • push消息 Push(mq string, msg string)
  • pop消息 Pop(mq string, num int)
  • 归档消息 Archive(mq string, id uint64)
  • 读取消息并设置时间等待归档或删除,等待时间内该消息不会再被读取 Read(mq string, num int, timeout time.Duration)
  • 删除消息 Delete(mq string, id uint64)
  • 获取队列长度 Len(mq string) int
  • 设置Key-Value SetKeyValue(mq string, key string, value string, expire time.Duration)
  • 获取Key-Value GetKeyValue(mq string, key string)
  • 删除Key-Value DelKeyValue(mq string, key string)

使用

golang
go install github.com/Rehtt/mq@latest

mkdir ~/.config/mq
mq -path ~/.config/mq/
docker
docker run -d -p 1234:1234 -v data:/data ghcr.io/rehtt/mq:master

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址