Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteAllStreams(js natsclient.JetStreamContext, cfg *config.JetStream)
- func InputRoomEventSubj(roomID string) string
- func JetStreamConsumer(ctx context.Context, js nats.JetStreamContext, subj, durable string, batch int, ...) error
- func Tokenise(str string) string
- type NATSInstance
Constants ¶
View Source
const ( UserID = "user_id" RoomID = "room_id" EventID = "event_id" )
Variables ¶
View Source
var ( InputRoomEvent = "InputRoomEvent" InputDeviceListUpdate = "InputDeviceListUpdate" InputSigningKeyUpdate = "InputSigningKeyUpdate" OutputRoomEvent = "OutputRoomEvent" OutputSendToDeviceEvent = "OutputSendToDeviceEvent" OutputKeyChangeEvent = "OutputKeyChangeEvent" OutputTypingEvent = "OutputTypingEvent" OutputClientData = "OutputClientData" OutputNotificationData = "OutputNotificationData" OutputReceiptEvent = "OutputReceiptEvent" OutputStreamEvent = "OutputStreamEvent" OutputReadUpdate = "OutputReadUpdate" RequestPresence = "GetPresence" OutputPresenceEvent = "OutputPresenceEvent" InputFulltextReindex = "InputFulltextReindex" )
Functions ¶
func DeleteAllStreams ¶ added in v0.8.3
func DeleteAllStreams(js natsclient.JetStreamContext, cfg *config.JetStream)
func InputRoomEventSubj ¶ added in v0.7.0
func JetStreamConsumer ¶ added in v0.6.1
func JetStreamConsumer( ctx context.Context, js nats.JetStreamContext, subj, durable string, batch int, f func(ctx context.Context, msgs []*nats.Msg) bool, opts ...nats.SubOpt, ) error
JetStreamConsumer starts a durable consumer on the given subject with the given durable name. The function will be called when one or more messages is available, up to the maximum batch size specified. If the batch is set to 1 then messages will be delivered one at a time. If the function is called, the messages array is guaranteed to be at least 1 in size. Any provided NATS options will be passed through to the pull subscriber creation. The consumer will continue to run until the context expires, at which point it will stop.
Types ¶
type NATSInstance ¶ added in v0.8.3
type NATSInstance struct {
*natsserver.Server
}
func (*NATSInstance) Prepare ¶ added in v0.8.3
func (s *NATSInstance) Prepare(process *process.ProcessContext, cfg *config.JetStream) (natsclient.JetStreamContext, *natsclient.Conn)
Click to show internal directories.
Click to hide internal directories.