mq

package
v0.0.0-...-00fc209 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	NatsAddress string `json:"nats_address"`
}

Conf is the configuration for the message queue.

type MQType

type MQType string

MQType is the type of message queue.

const (
	NATS MQType = "nats"
)

Message queue types

type MessageQueue

type MessageQueue interface {
	Connect() error
	Close() error
	Publish(subject string, data interface{}) error
	Subscribe(subject string, insertFunc insertFunction) error
	UnSubscribe() error
}

MessageQueue is the interface that wraps the basic message queue operations.

func NewMessageQueue

func NewMessageQueue(mqType MQType) MessageQueue

NewMessageQueue returns a new message queue instance.

func NewNatsMQ

func NewNatsMQ() MessageQueue

NewNatsMQ - create new nats message queue

Jump to

Keyboard shortcuts

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