publisher

package
v2.24.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogPublish added in v2.7.5

func LogPublish(logger log.Logger, event interface{}, subjects []string, err error)

func ResourceTypeToUUID added in v2.22.0

func ResourceTypeToUUID(resourceType string) string

Types

type FlusherTimeoutOpt

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

func WithFlusherTimeout

func WithFlusherTimeout(flusherTimeout time.Duration) FlusherTimeoutOpt

type LeadResourceTypeOpt added in v2.22.0

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

func WithLeadResourceType added in v2.22.0

func WithLeadResourceType(regexFilter []*regexp.Regexp, filter client.LeadResourceTypeFilter, useUUID bool) LeadResourceTypeOpt

type MarshalerFunc

type MarshalerFunc = func(v interface{}) ([]byte, error)

MarshalerFunc marshal struct to bytes.

type MarshalerOpt

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

func WithMarshaler

func WithMarshaler(dataMarshaler MarshalerFunc) MarshalerOpt

type Option

type Option interface {
	// contains filtered or unexported methods
}

type Publisher

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

Publisher implements a eventbus.Publisher interface.

func New

func New(conn *nats.Conn, jetstream bool, opts ...Option) (*Publisher, error)

Create publisher with existing NATS connection and proto marshaller

func (*Publisher) AddCloseFunc

func (p *Publisher) AddCloseFunc(f func())

func (*Publisher) Close

func (p *Publisher) Close()

func (*Publisher) Flush

func (p *Publisher) Flush(ctx context.Context) error

func (*Publisher) GetLeadResourceType added in v2.22.0

func (p *Publisher) GetLeadResourceType(event eventbus.Event) string

func (*Publisher) GetPublishSubject added in v2.22.0

func (p *Publisher) GetPublishSubject(owner string, event eventbus.Event) []string

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, topics []string, groupID, aggregateID string, event eventbus.Event) error

Publish publishes an event to topics.

func (*Publisher) PublishData

func (p *Publisher) PublishData(subj string, data []byte) error

Jump to

Keyboard shortcuts

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