rabbitmq

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package rabbitmq is a wrapper of the original "github.com/streadway/amqp" library.

Only contains basic publish, subscribe, and close methods. Data will be encoded to JSON before publishing the message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel is rabbitmq subscription channel.

func (*Channel) Close

func (c *Channel) Close() error

Close to close subscription.

func (*Channel) Read

func (c *Channel) Read(model interface{}) (<-chan interface{}, <-chan error)

Read to read incoming message.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is rabbitmq pubsub client.

func New

func New(url string) (*Client, error)

New to create new rabbitmq pubsub client.

func (*Client) Close

func (c *Client) Close() error

Close to close pubsub connection.

func (*Client) Publish

func (c *Client) Publish(queue string, data interface{}) error

Publish to publish message.

func (*Client) Subscribe

func (c *Client) Subscribe(queue string) (interface{}, error)

Subscribe to subscribe queue.

Jump to

Keyboard shortcuts

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