Versions in this module Expand all Collapse all v3 v3.2.0 Jul 26, 2023 v3.1.0 Jan 15, 2023 v3.0.1 May 23, 2022 v3.0.0 Mar 29, 2022 Changes in this version + const ExchangeDirect + const ExchangeFanout + const ExchangeHeaders + const ExchangeTopic + var ErrRequestRejected = errors.New("publishing Nacked") + var ErrRequestReturned = errors.New("publishing returned") + var ErrRequestTimeout = errors.New("request timed out") + var ErrUnexpectedConnClosed = errors.New("unexpected connection close without specific error") + func ContextWithQueueName(ctx context.Context, queueName string) context.Context + func ContextWithShutdownChan(ctx context.Context, ch chan struct{}) context.Context + func QueueNameFromContext(ctx context.Context) (string, bool) + func ShutdownChanFromContext(ctx context.Context) (chan struct{}, bool) + type AwareAcknowledger struct + Acknowledger amqp.Acknowledger + Handled bool + func NewAwareAcknowledger(acknowledger amqp.Acknowledger) *AwareAcknowledger + func (a *AwareAcknowledger) Ack(tag uint64, multiple bool) error + func (a *AwareAcknowledger) Nack(tag uint64, multiple, requeue bool) error + func (a *AwareAcknowledger) Reject(tag uint64, requeue bool) error + type Certificates struct + CA string + Cert string + Key string + func (c *Certificates) TLSConfig() *tls.Config + type Client struct + Sender SendFunc + func NewClient(url string) *Client + func (c *Client) AddMiddleware(m ClientMiddlewareFunc) *Client + func (c *Client) OnStarted(f OnStartedFunc) + func (c *Client) Send(r *Request) (*amqp.Delivery, error) + func (c *Client) Stop() + func (c *Client) WithConfirmMode(confirmMode bool) *Client + func (c *Client) WithConsumeSettings(s ConsumeSettings) *Client + func (c *Client) WithDebugLogger(f LogFunc) *Client + func (c *Client) WithDialConfig(dc amqp.Config) *Client + func (c *Client) WithDialTimeout(timeout time.Duration) *Client + func (c *Client) WithErrorLogger(f LogFunc) *Client + func (c *Client) WithMaxRetries(n int) *Client + func (c *Client) WithPublishSettings(s PublishSettings) *Client + func (c *Client) WithQueueDeclareSettings(s QueueDeclareSettings) *Client + func (c *Client) WithTLS(tlsConfig *tls.Config) *Client + func (c *Client) WithTimeout(t time.Duration) *Client + type ClientMiddlewareFunc func(next SendFunc) SendFunc + type ConsumeSettings struct + Args amqp.Table + AutoAck bool + Consumer string + Exclusive bool + QoSPrefetchCount int + QoSPrefetchSize int + type ExchangeDeclareSettings struct + Args amqp.Table + AutoDelete bool + Durable bool + type HandlerBinding struct + BindHeaders amqp.Table + ExchangeName string + ExchangeType string + Handler HandlerFunc + QueueName string + RoutingKey string + func DirectBinding(routingKey string, handler HandlerFunc) HandlerBinding + func FanoutBinding(exchangeName string, handler HandlerFunc) HandlerBinding + func HeadersBinding(queueName string, headers amqp.Table, handler HandlerFunc) HandlerBinding + func TopicBinding(queueName, routingKey string, handler HandlerFunc) HandlerBinding + type HandlerFunc func(context.Context, *ResponseWriter, amqp.Delivery) + func ServerMiddlewareChain(next HandlerFunc, m ...ServerMiddlewareFunc) HandlerFunc + type LogFunc func(format string, args ...interface{}) + type MockAcknowledger struct + Acks int + Nacks int + Rejects int + func (ma *MockAcknowledger) Ack(tag uint64, multiple bool) error + func (ma *MockAcknowledger) Nack(tag uint64, multiple, requeue bool) error + func (ma *MockAcknowledger) Reject(tag uint64, requeue bool) error + type OnStartedFunc func(inputConn, outputConn *amqp.Connection, ...) + type PublishSettings struct + ConfirmMode bool + Immediate bool + Mandatory bool + type QueueDeclareSettings struct + Args amqp.Table + DeleteWhenUnused bool + Durable bool + Exclusive bool + type Request struct + Context context.Context + Exchange string + Publishing amqp.Publishing + Reply bool + RoutingKey string + Timeout time.Duration + func NewRequest() *Request + func (r *Request) AddMiddleware(m ClientMiddlewareFunc) *Request + func (r *Request) AfterTimeout() <-chan time.Time + func (r *Request) WithBody(b string) *Request + func (r *Request) WithContentType(ct string) *Request + func (r *Request) WithContext(ctx context.Context) *Request + func (r *Request) WithCorrelationID(id string) *Request + func (r *Request) WithExchange(e string) *Request + func (r *Request) WithHeaders(h amqp.Table) *Request + func (r *Request) WithResponse(wr bool) *Request + func (r *Request) WithRoutingKey(rk string) *Request + func (r *Request) WithTimeout(t time.Duration) *Request + func (r *Request) Write(p []byte) (int, error) + func (r *Request) WriteHeader(header string, value interface{}) + type RequestMap struct + func (m *RequestMap) Delete(r *Request) + func (m *RequestMap) GetByCorrelationID(key string) (*Request, bool) + func (m *RequestMap) GetByDeliveryTag(key uint64) (*Request, bool) + func (m *RequestMap) Set(r *Request) + type ResponseWriter struct + Immediate bool + Mandatory bool + Publishing *amqp.Publishing + func NewResponseWriter(p *amqp.Publishing) *ResponseWriter + func (rw *ResponseWriter) Write(p []byte) (int, error) + func (rw *ResponseWriter) WriteHeader(header string, value interface{}) + type SendFunc func(r *Request) (d *amqp.Delivery, e error) + func ClientMiddlewareChain(next SendFunc, m ...ClientMiddlewareFunc) SendFunc + type Server struct + func NewServer(url string) *Server + func (s *Server) AddMiddleware(m ServerMiddlewareFunc) *Server + func (s *Server) Bind(binding HandlerBinding) + func (s *Server) ListenAndServe() + func (s *Server) OnStarted(f OnStartedFunc) + func (s *Server) Stop() + func (s *Server) WithAutoAck(b bool) *Server + func (s *Server) WithConsumeSettings(settings ConsumeSettings) *Server + func (s *Server) WithDebugLogger(f LogFunc) *Server + func (s *Server) WithDialConfig(c amqp.Config) *Server + func (s *Server) WithDialTimeout(timeout time.Duration) *Server + func (s *Server) WithErrorLogger(f LogFunc) *Server + func (s *Server) WithExchangeDeclareSettings(settings ExchangeDeclareSettings) *Server + func (s *Server) WithQoSPrefetchCount(c int) *Server + func (s *Server) WithQueueDeclareSettings(settings QueueDeclareSettings) *Server + func (s *Server) WithTLS(tlsConfig *tls.Config) *Server + type ServerMiddlewareFunc func(next HandlerFunc) HandlerFunc Other modules containing this package github.com/0x4b53/amqp-rpc github.com/0x4b53/amqp-rpc/v2 github.com/0x4b53/amqp-rpc/v4