Documentation
¶
Index ¶
Constants ¶
View Source
const ServerName = "platform"
Variables ¶
View Source
var ErrNoNatsConnection = errors.New("nats connection has not been established. Call Open() first")
Functions ¶
func NewDefaultServerOptions ¶
NewDefaultServerOptions returns the default NATS server options, allowing the caller to override specific fields.
Types ¶
type AsyncPublisher ¶
type AsyncPublisher struct {
ClientID string
Connection stan.Conn
Addr string
// contains filtered or unexported fields
}
func NewAsyncPublisher ¶
func NewAsyncPublisher(log *zap.Logger, clientID string, addr string) *AsyncPublisher
func (*AsyncPublisher) Open ¶
func (p *AsyncPublisher) Open() error
Open creates and maintains a connection to NATS server
type Handler ¶
type Handler interface {
// Process does something with a received subscription message, then acks it.
Process(s Subscription, m Message)
}
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
func (*LogHandler) Process ¶
func (lh *LogHandler) Process(s Subscription, m Message)
type QueueSubscriber ¶
func NewQueueSubscriber ¶
func NewQueueSubscriber(clientID string, addr string) *QueueSubscriber
func (*QueueSubscriber) Open ¶
func (s *QueueSubscriber) Open() error
Open creates and maintains a connection to NATS server
type Server ¶
type Server struct {
Server *sserver.StanServer
// contains filtered or unexported fields
}
Server wraps a connection to a NATS streaming server
type Subscriber ¶
type Subscription ¶
type Subscription interface {
// Pending returns the number of queued messages and queued bytes for this subscription.
Pending() (int64, int64, error)
// Delivered returns the number of delivered messages for this subscription.
Delivered() (int64, error)
// Close removes this subscriber
Close() error
}
Click to show internal directories.
Click to hide internal directories.