client

package
v0.0.0-...-65c615f Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrChannelClosed = errors.New("channel has been closed")

Functions

This section is empty.

Types

type Channel

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

func (*Channel) Ack

func (c *Channel) Ack() error

func (*Channel) Close

func (c *Channel) Close() error

func (*Channel) GetMsg

func (c *Channel) GetMsg() []byte

func (*Channel) WaitMsg

func (c *Channel) WaitMsg(d time.Duration) []byte

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(jsonConfig json.RawMessage) (*Client, error)

func NewClientWithConfig

func NewClientWithConfig(cfg *Config) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Get

func (c *Client) Get() (*Conn, error)

func (*Client) Publish

func (c *Client) Publish(queue string, routingKey string, body []byte, pubType string) (int64, error)

func (*Client) PublishDirect

func (c *Client) PublishDirect(queue string, routingKey string, body []byte) (int64, error)

func (*Client) PublishFanout

func (c *Client) PublishFanout(queue string, body []byte) (int64, error)

type Config

type Config struct {
	BrokerAddr   string `json:"broker_addr"`
	KeepAlive    int    `json:"keepalive"`
	IdleConns    int    `json:"idle_conns"`
	MaxQueueSize int    `json:"max_queue_size"`
}

func NewDefaultConfig

func NewDefaultConfig() *Config

type Conn

type Conn struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Conn) Bind

func (c *Conn) Bind(queue string, routingKey string, noAck bool) (*Channel, error)

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) Publish

func (c *Conn) Publish(queue string, routingKey string, body []byte, pubType string) (int64, error)

Jump to

Keyboard shortcuts

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