Versions in this module Expand all Collapse all v0 v0.1.0 Jun 24, 2016 Changes in this version + const DefaultACKPrefix + const DefaultAckWait + const DefaultConnectWait + const DefaultDiscoverPrefix + const DefaultMaxInflight + const DefaultMaxPubAcksInflight + const DefaultNatsURL + const Version + var DefaultOptions = Options + var DefaultSubscriptionOptions = SubscriptionOptions + var ErrBadAck = errors.New("stan: malformed ack") + var ErrBadConnection = errors.New("stan: invalid connection") + var ErrBadSubscription = errors.New("stan: invalid subscription") + var ErrCloseReqTimeout = errors.New("stan: close request timeout") + var ErrConnectReqTimeout = errors.New("stan: connect request timeout") + var ErrConnectionClosed = errors.New("stan: connection closed") + var ErrManualAck = errors.New("stan: cannot manually ack in auto-ack mode") + var ErrNilMsg = errors.New("stan: nil message") + var ErrTimeout = errors.New("stan: publish ack timeout") + type AckHandler func(string, error) + type Conn interface + Close func() error + Publish func(subject string, data []byte) error + PublishAsync func(subject string, data []byte, ah AckHandler) (string, error) + PublishAsyncWithReply func(subject, reply string, data []byte, ah AckHandler) (string, error) + PublishWithReply func(subject, reply string, data []byte) error + QueueSubscribe func(subject, qgroup string, cb MsgHandler, opts ...SubscriptionOption) (Subscription, error) + Subscribe func(subject string, cb MsgHandler, opts ...SubscriptionOption) (Subscription, error) + func Connect(stanClusterID, clientID string, options ...Option) (Conn, error) + type Msg struct + Sub Subscription + func (msg *Msg) Ack() error + type MsgHandler func(msg *Msg) + type Option func(*Options) error + func ConnectWait(t time.Duration) Option + func NatsConn(nc *nats.Conn) Option + func PubAckWait(t time.Duration) Option + type Options struct + AckTimeout time.Duration + ConnectTimeout time.Duration + DiscoverPrefix string + MaxPubAcksInflight int + NatsConn *nats.Conn + NatsURL string + type Subscription interface + Unsubscribe func() error + type SubscriptionOption func(*SubscriptionOptions) error + func AckWait(t time.Duration) SubscriptionOption + func DeliverAllAvailable() SubscriptionOption + func DurableName(name string) SubscriptionOption + func MaxInflight(m int) SubscriptionOption + func SetManualAckMode() SubscriptionOption + func StartAt(sp pb.StartPosition) SubscriptionOption + func StartAtSequence(seq uint64) SubscriptionOption + func StartAtTime(start time.Time) SubscriptionOption + func StartAtTimeDelta(ago time.Duration) SubscriptionOption + func StartWithLastReceived() SubscriptionOption + type SubscriptionOptions struct + AckWait time.Duration + DurableName string + ManualAcks bool + MaxInflight int + StartAt pb.StartPosition + StartSequence uint64 + StartTime time.Time