Categorygithub.com/go-zoox/mq
modulepackage
1.0.1
Repository: https://github.com/go-zoox/mq.git
Documentation: pkg.go.dev

# README

MQ - lightweight message queue

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/mq

Getting Started

Consumer

import (
  "github.com/go-zoox/mq"
)

func main(t *testing.T) {
	m := mq.New(&mq.Config{
		RedisHost:     <RedisHost>,
		RedisPort:     <RedisPort>,
		RedisUsername: <RedisUsername>,
		RedisPassword: <RedisPassword>,
		RedisDB:       <RedisDB>,
	})

	m.Consume(context.TODO(), "default", func(msg *mq.Message) error {
		logger.Infof("received message: %s", string(msg.Body))
		return nil
	})
}

Producer

import (
  "github.com/go-zoox/mq"
)

func main(t *testing.T) {
	m := mq.New(&mq.Config{
		RedisHost:     <RedisHost>,
		RedisPort:     <RedisPort>,
		RedisUsername: <RedisUsername>,
		RedisPassword: <RedisPassword>,
		RedisDB:       <RedisDB>,
	})

	m.Send(context.TODO(), &mq.Message{
		Topic: "default",
		Body:  []byte("hello world"),
	})
}

License

GoZoox is released under the MIT License.

# Packages

No description provided by the author

# Functions

New creates a new mq.

# Variables

Version is the current version of the package.

# Structs

Config is the config for a mq.
Message ...

# Interfaces

MQ is a simple message queue.

# Type aliases

Handler is a mq handler.