Documentation ¶
Index ¶
- Constants
- func SetConfigs(conf *Config) func(*NatsStreamingService) error
- func SetContext(ctx context.Context) func(*NatsStreamingService) error
- func SetPubID(pubID string) func(*NatsStreamingService) error
- type Config
- type MsgEvent
- type MsgSubInfo
- type NatsStreamingService
- type StorageSubscribeLast
- type StreamingService
- type SubscribeStartType
- type SubscribeType
- type SubscriberConfig
Constants ¶
View Source
const ( DefaultMaxPubAcksInflight = 1000 DefaultMsgChanSize = 500 )
Variables ¶
This section is empty.
Functions ¶
func SetConfigs ¶
func SetConfigs(conf *Config) func(*NatsStreamingService) error
func SetContext ¶
func SetContext(ctx context.Context) func(*NatsStreamingService) error
func SetPubID ¶
func SetPubID(pubID string) func(*NatsStreamingService) error
Types ¶
type MsgSubInfo ¶
type NatsStreamingService ¶
type NatsStreamingService struct {
// contains filtered or unexported fields
}
func NewStreamingService ¶
func NewStreamingService(options ...func(*NatsStreamingService) error) *NatsStreamingService
func (*NatsStreamingService) Close ¶
func (n *NatsStreamingService) Close()
func (*NatsStreamingService) Connect ¶
func (n *NatsStreamingService) Connect()
func (*NatsStreamingService) PublisherPush ¶
func (n *NatsStreamingService) PublisherPush(subject string, data []byte)
func (*NatsStreamingService) RunPublisher ¶
func (n *NatsStreamingService) RunPublisher()
func (*NatsStreamingService) RunSubscriber ¶
func (n *NatsStreamingService) RunSubscriber(config SubscriberConfig) error
type StorageSubscribeLast ¶
type StorageSubscribeLast interface {
SaveLastMessageInfo(key string, lastMsgInfo MsgSubInfo) error
}
type StreamingService ¶
type StreamingService interface { Connect() RunPublisher() RunSubscriber(config SubscriberConfig) error PublisherPush(subject string, data []byte) Close() }
type SubscribeStartType ¶
type SubscribeStartType int
const ( StartWithLastReceived SubscribeStartType = (1 + iota) // Последнее полученное сообщение DeliverAllAvailable // Начало канала StartAtSequence // Конкретное сообщение, индексация начинается с 1 StartAtTime // Конкретное время, когда сообщение пришло на канал )
func (SubscribeStartType) String ¶
func (t SubscribeStartType) String() string
func (SubscribeStartType) Val ¶
func (t SubscribeStartType) Val() int
type SubscribeType ¶
type SubscribeType int
const ( ClassicSubscribe SubscribeType = (1 + iota) QueueSubscribe )
func (SubscribeType) String ¶
func (s SubscribeType) String() string
func (SubscribeType) Val ¶
func (s SubscribeType) Val() int
type SubscriberConfig ¶
type SubscriberConfig struct { Type SubscribeType StartType SubscribeStartType QueueName *string SubMsgChan *channels.RingChannel UnsubscribeAfterSubscribeEnd bool ChannelName *string MsgHandler func(m *stan.Msg) LastMsgStorage StorageSubscribeLast MaxInflight *int AckWaitSeconds *int DurableName *string // only for 'Durable' subscribes or queues StartMsgPosition *int // only for 'StartAtSequence' type StartTime *time.Time // only for 'StartAtTime' type }
Click to show internal directories.
Click to hide internal directories.