Versions in this module Expand all Collapse all v0 v0.1.1 Jan 25, 2019 Changes in this version + const ClientVersion + const ProtoVersion + var ErrClosedProducer = errors.New("producer is closed") + type Client struct + func NewClient(cfg ClientConfig) (*Client, error) + func (c *Client) Close() error + func (c *Client) Closed() <-chan struct{} + func (c *Client) Connect(ctx context.Context, proxyBrokerURL string) (*api.CommandConnected, error) + func (c *Client) ConnectTLS(ctx context.Context, proxyBrokerURL string) (*api.CommandConnected, error) + func (c *Client) LookupTopic(ctx context.Context, topic string, authoritative bool) (*api.CommandLookupTopicResponse, error) + func (c *Client) NewExclusiveConsumer(ctx context.Context, topic, subscriptionName string, earliest bool, ...) (*Consumer, error) + func (c *Client) NewFailoverConsumer(ctx context.Context, topic, subscriptionName string, queue chan Message) (*Consumer, error) + func (c *Client) NewProducer(ctx context.Context, topic, producerName string) (*Producer, error) + func (c *Client) NewSharedConsumer(ctx context.Context, topic, subscriptionName string, queue chan Message) (*Consumer, error) + func (c *Client) Ping(ctx context.Context) error + type ClientConfig struct + Addr string + DialTimeout time.Duration + Errs chan<- error + TLSConfig *tls.Config + type Consumer struct + func (c *Consumer) Ack(msg Message) error + func (c *Consumer) Close(ctx context.Context) error + func (c *Consumer) Closed() <-chan struct{} + func (c *Consumer) ConnClosed() <-chan struct{} + func (c *Consumer) Flow(permits uint32) error + func (c *Consumer) Messages() <-chan Message + func (c *Consumer) ReachedEndOfTopic() <-chan struct{} + func (c *Consumer) RedeliverOverflow(ctx context.Context) (int, error) + func (c *Consumer) RedeliverUnacknowledged(ctx context.Context) error + func (c *Consumer) Unsubscribe(ctx context.Context) error + type ErrUnexpectedMsg struct + func (e *ErrUnexpectedMsg) Error() string + type ManagedClient struct + func NewManagedClient(cfg ManagedClientConfig) *ManagedClient + func (m *ManagedClient) Done() <-chan struct{} + func (m *ManagedClient) Get(ctx context.Context) (*Client, error) + func (m *ManagedClient) Stop() error + type ManagedClientConfig struct + ConnectTimeout time.Duration + InitialReconnectDelay time.Duration + MaxReconnectDelay time.Duration + PingFrequency time.Duration + PingTimeout time.Duration + type ManagedClientPool struct + func NewManagedClientPool() *ManagedClientPool + func (m *ManagedClientPool) ForTopic(ctx context.Context, cfg ManagedClientConfig, topic string) (*ManagedClient, error) + func (m *ManagedClientPool) Get(cfg ManagedClientConfig) *ManagedClient + type ManagedConsumer struct + func NewManagedConsumer(cp *ManagedClientPool, cfg ManagedConsumerConfig) *ManagedConsumer + func (m *ManagedConsumer) Ack(ctx context.Context, msg Message) error + func (m *ManagedConsumer) Close(ctx context.Context) error + func (m *ManagedConsumer) Monitor() func() + func (m *ManagedConsumer) Receive(ctx context.Context) (Message, error) + func (m *ManagedConsumer) ReceiveAsync(ctx context.Context, msgs chan<- Message) error + func (m *ManagedConsumer) RedeliverOverflow(ctx context.Context) (int, error) + func (m *ManagedConsumer) RedeliverUnacknowledged(ctx context.Context) error + func (m *ManagedConsumer) Unsubscribe(ctx context.Context) error + type ManagedConsumerConfig struct + Earliest bool + Exclusive bool + InitialReconnectDelay time.Duration + MaxReconnectDelay time.Duration + Name string + NewConsumerTimeout time.Duration + QueueSize int + Topic string + type ManagedProducer struct + func NewManagedProducer(cp *ManagedClientPool, cfg ManagedProducerConfig) *ManagedProducer + func (m *ManagedProducer) Close(ctx context.Context) error + func (m *ManagedProducer) Monitor() func() + func (m *ManagedProducer) Send(ctx context.Context, payload []byte) (*api.CommandSendReceipt, error) + type ManagedProducerConfig struct + InitialReconnectDelay time.Duration + MaxReconnectDelay time.Duration + Name string + NewProducerTimeout time.Duration + Topic string + type Message struct + Meta *api.MessageMetadata + Msg *api.CommandMessage + Payload []byte + Topic string + func (m *Message) Equal(other *Message) bool + type Producer struct + func (p *Producer) Close(ctx context.Context) error + func (p *Producer) Closed() <-chan struct{} + func (p *Producer) ConnClosed() <-chan struct{} + func (p *Producer) Send(ctx context.Context, payload []byte) (*api.CommandSendReceipt, error)