once

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	IsSkip(msg interface{}) bool
	MarkAsSent(msg interface{}) error
}

Checker provides test interface of messages

type PublisherWrapper

type PublisherWrapper struct {
	// contains filtered or unexported fields
}

PublisherWrapper provides additional check before send message to the stream

func MewPublisherWrapper

func MewPublisherWrapper(pub nc.Publisher, checker Checker) *PublisherWrapper

MewPublisherWrapper with checker

func (*PublisherWrapper) Close

func (wr *PublisherWrapper) Close() error

Close publisher if supported

func (*PublisherWrapper) Publish

func (wr *PublisherWrapper) Publish(ctx context.Context, messages ...interface{}) error

Publish one or more messages to the pub-service if will pass conditions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL