Categorygithub.com/grafana/go-rsmq
modulepackage
0.1.0
Repository: https://github.com/grafana/go-rsmq.git
Documentation: pkg.go.dev

# README

go-rsmq

GoDoc

A Go implementation of the Node.js rsmq package.

Example

// Create a redis client
client := redis.NewClient(&redis.Options{
  Addr:     "localhost:6379",
})

mq := rsmq.NewRedisSMQ(client, "")

err = mq.CreateQueue("myqueue")
if err != nil {
  return err
}

messageID, err := mq.SendMessage("myqueue", "hello")
if err != nil {
  return err
}

message, err := mq.ReceiveMessage("myqueue")
if err != nil {
  return err
}

if message != nil {
  mq.DeleteMessage("myqueue", message.ID)
  if err != nil {
    return err
  }
}

TODO

  • Finish tests. The message send side is covered ok, but not the receive side.

# Functions

NewRedisSMQ creates a new RedisSMQ object.

# Variables

Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.
Errors that can be returned from RedisSMQ operations.

# Structs

QueueAttributes contains settings and stats for a queue.
QueueMessage contains information for a message stored in a queue.
RedisSMQ is used to manage queues and messages.