Documentation ¶
Index ¶
- type Initializer
- type Option
- type Publisher
- func (s *Publisher) JS() nats.JetStreamContext
- func (s *Publisher) Marshall(v interface{}) ([]byte, error)
- func (s *Publisher) NewMsg(v interface{}) (*nats.Msg, error)
- func (s *Publisher) PubOpts(opts ...nats.PubOpt) []nats.PubOpt
- func (s *Publisher) PublishMsg(data interface{}, opts ...nats.PubOpt) (*nats.PubAck, error)
- func (s *Publisher) PublishMsgAsync(data interface{}, opts ...nats.PubOpt) (nats.PubAckFuture, error)
- func (s *Publisher) Subject() string
- type PublisherOption
- type Stream
- func (s *Stream) Conn() *nats.Conn
- func (s *Stream) Info() *nats.StreamInfo
- func (s *Stream) JS() nats.JetStreamContext
- func (s *Stream) Name() string
- func (s *Stream) Publisher(subject string, opts ...PublisherOption) *Publisher
- func (s *Stream) Subscriber(subject string, opts ...SubscriberOption) *Subscriber
- type Subscriber
- func (s *Subscriber) JS() nats.JetStreamContext
- func (s *Subscriber) QueueSubscribe(queue string, handler stream.MsgHandler, opts ...nats.SubOpt) (*nats.Subscription, error)
- func (s *Subscriber) SubOpts(opts ...nats.SubOpt) []nats.SubOpt
- func (s *Subscriber) Subject() string
- func (s *Subscriber) Subscribe(handler stream.MsgHandler, opts ...nats.SubOpt) (*nats.Subscription, error)
- func (s *Subscriber) Unmarshall(msg *nats.Msg, v interface{}) error
- type SubscriberOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Initializer ¶
type Option ¶
type Option func(*Stream)
func WithConfig ¶
func WithConfig(v *nats.StreamConfig) Option
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func (*Publisher) PublishMsg ¶
func (*Publisher) PublishMsgAsync ¶
type PublisherOption ¶
type PublisherOption func(*Publisher)
func PublisherWithHeader ¶
func PublisherWithHeader(v nats.Header) PublisherOption
func PublisherWithPubOpts ¶
func PublisherWithPubOpts(v ...nats.PubOpt) PublisherOption
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) Publisher ¶
func (s *Stream) Publisher(subject string, opts ...PublisherOption) *Publisher
func (*Stream) Subscriber ¶
func (s *Stream) Subscriber(subject string, opts ...SubscriberOption) *Subscriber
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func (*Subscriber) JS ¶
func (s *Subscriber) JS() nats.JetStreamContext
func (*Subscriber) QueueSubscribe ¶
func (s *Subscriber) QueueSubscribe(queue string, handler stream.MsgHandler, opts ...nats.SubOpt) (*nats.Subscription, error)
func (*Subscriber) SubOpts ¶
func (s *Subscriber) SubOpts(opts ...nats.SubOpt) []nats.SubOpt
func (*Subscriber) Subject ¶
func (s *Subscriber) Subject() string
func (*Subscriber) Subscribe ¶
func (s *Subscriber) Subscribe(handler stream.MsgHandler, opts ...nats.SubOpt) (*nats.Subscription, error)
func (*Subscriber) Unmarshall ¶
func (s *Subscriber) Unmarshall(msg *nats.Msg, v interface{}) error
type SubscriberOption ¶
type SubscriberOption func(*Subscriber)
func SubscriberWithNamespace ¶
func SubscriberWithNamespace(v string) SubscriberOption
func SubscriberWithSubOpts ¶
func SubscriberWithSubOpts(v ...nats.SubOpt) SubscriberOption
Click to show internal directories.
Click to hide internal directories.