qcat

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: MIT Imports: 15 Imported by: 0

README

qcat GoDoc

A utility for publishing and consuming data from an AMQP message broker

Documentation

Index

Constants

View Source
const Version = `1.0.3`

Variables

View Source
var DefaultQueueName = `qcat`
View Source
var DefaultServerAddress = `:17684`

Functions

This section is empty.

Types

type AMQP added in v1.0.2

type AMQP struct {
	ID           string
	Host         string
	Port         int
	Username     string
	Password     string
	Vhost        string
	ExchangeName string
	RoutingKey   string
	QueueName    string
	Durable      bool
	Autodelete   bool
	Exclusive    bool
	Mandatory    bool
	Immediate    bool
	// contains filtered or unexported fields
}

func NewAMQP added in v1.0.2

func NewAMQP(uri string) (*AMQP, error)

func (*AMQP) Close added in v1.0.2

func (self *AMQP) Close() error

func (*AMQP) Connect added in v1.0.2

func (self *AMQP) Connect() error

func (*AMQP) Err added in v1.0.2

func (self *AMQP) Err() <-chan error

Receive a single error.

func (*AMQP) Publish added in v1.0.2

func (self *AMQP) Publish(data []byte, header MessageHeader) error

Publish a single message.

func (*AMQP) PublishLines added in v1.0.2

func (self *AMQP) PublishLines(reader io.Reader, header MessageHeader) error

Publish messages read from the given reader, separated by newlines ("\n").

func (*AMQP) Receive added in v1.0.2

func (self *AMQP) Receive() <-chan *Message

Receive a single message.

func (*AMQP) Subscribe added in v1.0.2

func (self *AMQP) Subscribe() error

Receive a message from the channel.

func (*AMQP) SubscribeRaw added in v1.0.2

func (self *AMQP) SubscribeRaw() (<-chan amqp.Delivery, error)

type DeliveryMode added in v1.0.1

type DeliveryMode int
const (
	Transient  DeliveryMode = 1
	Persistent              = 2
)

type HttpServer

type HttpServer struct {
	BaseHeader MessageHeader
	// contains filtered or unexported fields
}

func NewHttpServer

func NewHttpServer(amqpClient *AMQP) *HttpServer

func (*HttpServer) ListenAndServe

func (self *HttpServer) ListenAndServe(address string) error

func (*HttpServer) Respond

func (self *HttpServer) Respond(w http.ResponseWriter, code int, payload interface{}, err error)

func (*HttpServer) ServeHTTP

func (self *HttpServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Message added in v1.0.1

type Message struct {
	Timestamp time.Time
	Header    MessageHeader
	Body      []byte
}

func (*Message) Decode added in v1.0.1

func (self *Message) Decode(into interface{}) error

type MessageHeader

type MessageHeader struct {
	ContentType     string
	ContentEncoding string
	DeliveryMode    DeliveryMode
	Priority        int
	Expiration      time.Duration
}

Directories

Path Synopsis
cmd
qcat command

Jump to

Keyboard shortcuts

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