Documentation ¶
Index ¶
- Constants
- Variables
- func GetJetstreamMsgContext(msg jetstream.Msg) (spanContext trace.SpanContext, err error)
- func GetNatsMsgContext(msg *nats.Msg) (spanContext trace.SpanContext, err error)
- func SanitizeKey(in string) string
- type ConsumeErrRestartFn
- type JSWrapper
- func (j *JSWrapper) ConsumeErrHandler(logger *zap.Logger) jetstream.PullConsumeOpt
- func (j *JSWrapper) ConsumeErrHandlerWithRestart(ctxCancel context.Context, logger *zap.Logger, restartFn ConsumeErrRestartFn) jetstream.PullConsumeOpt
- func (j *JSWrapper) CreateOrUpdateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
- func (j *JSWrapper) CreateOrUpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
- func (j *JSWrapper) Publish(ctx context.Context, subject string, payload []byte, ...) (*jetstream.PubAck, error)
- func (j *JSWrapper) PublishAsync(ctx context.Context, subject string, payload []byte, ...) (jetstream.PubAckFuture, error)
- func (j *JSWrapper) PublishAsyncProto(ctx context.Context, subject string, msg proto.Message, ...) (jetstream.PubAckFuture, error)
- func (j *JSWrapper) PublishMsg(ctx context.Context, msg *nats.Msg, opts ...jetstream.PublishOpt) (*jetstream.PubAck, error)
- func (j *JSWrapper) PublishMsgAsync(ctx context.Context, msg *nats.Msg, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
- func (j *JSWrapper) PublishProto(ctx context.Context, subject string, msg proto.Message, ...) (*jetstream.PubAck, error)
- type Params
- type Result
- type Subject
- type Topic
- type Type
Constants ¶
View Source
const ( MaxRestartRetries = 5 InitialRestartBackoffTime = 150 * time.Millisecond )
View Source
const DefaultDefaultAsyncPubAckInflight = 256
Default `defaultAsyncPubAckInflight` is `4000` (`nats.go`)
View Source
const DescriptionPrefix = "FiveNet: "
Variables ¶
Functions ¶
func GetJetstreamMsgContext ¶
func GetJetstreamMsgContext(msg jetstream.Msg) (spanContext trace.SpanContext, err error)
func GetNatsMsgContext ¶
func GetNatsMsgContext(msg *nats.Msg) (spanContext trace.SpanContext, err error)
func SanitizeKey ¶ added in v0.9.2
Types ¶
type ConsumeErrRestartFn ¶
type JSWrapper ¶
Ensures certain NATS config options are applied
func NewJSWrapper ¶
func (*JSWrapper) ConsumeErrHandler ¶
func (j *JSWrapper) ConsumeErrHandler(logger *zap.Logger) jetstream.PullConsumeOpt
func (*JSWrapper) ConsumeErrHandlerWithRestart ¶
func (j *JSWrapper) ConsumeErrHandlerWithRestart(ctxCancel context.Context, logger *zap.Logger, restartFn ConsumeErrRestartFn) jetstream.PullConsumeOpt
func (*JSWrapper) CreateOrUpdateKeyValue ¶
func (*JSWrapper) CreateOrUpdateStream ¶
func (*JSWrapper) PublishAsync ¶
func (j *JSWrapper) PublishAsync(ctx context.Context, subject string, payload []byte, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
func (*JSWrapper) PublishAsyncProto ¶
func (*JSWrapper) PublishMsg ¶
func (*JSWrapper) PublishMsgAsync ¶
func (j *JSWrapper) PublishMsgAsync(ctx context.Context, msg *nats.Msg, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
Click to show internal directories.
Click to hide internal directories.