nats

package module
v0.0.0-...-8267bd7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2013 License: Apache-2.0 Imports: 14 Imported by: 0

README

File a Bug

To file a bug against Cloud Foundry Open Source and its components, sign up and use our bug tracking system: http://cloudfoundry.atlassian.net

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthenticationFailure = errors.New("nats: authentication failed")
	ErrHandshakeTimeout      = errors.New("nats: handshake timed out")
)
View Source
var (
	ErrLineTooLong   = errors.New("reader: line too long")
	ErrUnknownObject = errors.New("reader: unknown object")
	ErrInvalidObject = errors.New("reader: invalid object")
)
View Source
var EmptyHandshake = emptyHandshake{}

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient() *Client

func (*Client) AcquireConnection

func (t *Client) AcquireConnection() *Connection

func (*Client) Deliver

func (sr *Client) Deliver(m *readMessage)

func (*Client) NewSubscription

func (sr *Client) NewSubscription(sub string) *Subscription

func (*Client) Ping

func (t *Client) Ping() bool

func (*Client) Publish

func (t *Client) Publish(s string, m []byte) bool

func (*Client) PublishAndConfirm

func (t *Client) PublishAndConfirm(s string, m []byte) bool

func (*Client) Request

func (t *Client) Request(s string, m []byte, f func(*Subscription)) bool

func (*Client) Resubscribe

func (sr *Client) Resubscribe(c *Connection)

func (*Client) Run

func (t *Client) Run(d Dialer, h Handshaker) error

func (*Client) RunWithDefaults

func (t *Client) RunWithDefaults(addr string, user, pass string) error

func (*Client) Subscribe

func (sr *Client) Subscribe(s *Subscription)

func (*Client) Unsubscribe

func (sr *Client) Unsubscribe(s *Subscription)

func (*Client) Write

func (t *Client) Write(o writeObject) bool

type Connection

type Connection struct {
	Stopper
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(rw io.ReadWriteCloser) *Connection

func (*Connection) Ping

func (c *Connection) Ping() bool

func (*Connection) Run

func (c *Connection) Run() error

func (*Connection) Write

func (c *Connection) Write(o writeObject) bool

func (*Connection) WriteAndPing

func (c *Connection) WriteAndPing(o writeObject) bool

func (*Connection) WriteChannel

func (c *Connection) WriteChannel(oc chan writeObject) bool

type Dialer

type Dialer interface {
	Dial() (net.Conn, error)
}

func DefaultDialer

func DefaultDialer(addr string) Dialer

type DumbChannelDialer

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

func (DumbChannelDialer) Dial

func (d DumbChannelDialer) Dial() (net.Conn, error)

type DumbDialer

type DumbDialer struct {
	Conn net.Conn
}

func (DumbDialer) Dial

func (d DumbDialer) Dial() (net.Conn, error)

type Handshake

type Handshake struct {
	Username string
	Password string
}

func (Handshake) Handshake

func (h Handshake) Handshake(c net.Conn) (net.Conn, error)

type Handshaker

type Handshaker interface {
	Handshake(net.Conn) (net.Conn, error)
}

func DefaultHandshaker

func DefaultHandshaker(username, password string) Handshaker

type RetryingDialer

type RetryingDialer struct {

	// Address to connect to
	Addr string

	// Maximum number of connection attempts
	MaxAttempts uint
	// contains filtered or unexported fields
}

func (RetryingDialer) Dial

func (d RetryingDialer) Dial() (net.Conn, error)

type Stopper

type Stopper struct {
	sync.Once
	// contains filtered or unexported fields
}

func (*Stopper) Init

func (s *Stopper) Init()

func (*Stopper) MarkStart

func (s *Stopper) MarkStart() chan bool

func (*Stopper) MarkStop

func (s *Stopper) MarkStop()

func (*Stopper) Stop

func (s *Stopper) Stop()

type Subscription

type Subscription struct {
	Inbox chan *readMessage
	// contains filtered or unexported fields
}

func (*Subscription) SetMaximum

func (s *Subscription) SetMaximum(v uint)

func (*Subscription) SetQueue

func (s *Subscription) SetQueue(v string)

func (*Subscription) SetSubject

func (s *Subscription) SetSubject(v string)

func (*Subscription) Subscribe

func (s *Subscription) Subscribe()

Proxy to registry

func (*Subscription) Unsubscribe

func (s *Subscription) Unsubscribe()

Proxy to registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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