publisher

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakePublisher

func NewFakePublisher() message.Publisher

Types

type FakePublishedEntry

type FakePublishedEntry struct {
	Topic    string
	Messages []*message.Message
}

type FakePublisher

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

func (*FakePublisher) ClearPublished

func (p *FakePublisher) ClearPublished()

func (*FakePublisher) Close

func (p *FakePublisher) Close() error

func (*FakePublisher) GetPublished

func (p *FakePublisher) GetPublished() []*FakePublishedEntry

func (*FakePublisher) Publish

func (p *FakePublisher) Publish(topic string, messages ...*message.Message) error

type Publisher

type Publisher struct {
	Publisher message.Publisher
	Retry     *middleware.Retry
}

func NewPublisher

func NewPublisher(
	logger *zap.Logger,
	config *PublisherConfig,
) *Publisher

func (*Publisher) Close added in v0.1.2

func (p *Publisher) Close() error

func (*Publisher) NewMessage

func (p *Publisher) NewMessage(
	ctx context.Context,
	payload proto.Message,
) (*message.Message, error)

func (*Publisher) Publish added in v0.1.2

func (p *Publisher) Publish(topic string, messages ...*message.Message) error

type PublisherConfig

type PublisherConfig struct {
	OnGCP                  bool
	ProjectId              string  // only applicable if OnGCP is true
	Name                   *string // defaults to "pubsub.Publish" if not set
	ConnectTimeoutSecs     *int
	PublishTimeoutSecs     *int
	GrpcConnectionPoolSize *int
	RetryConfig            *PublisherRetryConfig
}

type PublisherRetryConfig added in v0.1.2

type PublisherRetryConfig struct {
	MaxRetries          *int
	InitialInterval     *time.Duration
	RandomizationFactor *float64
	Multiplier          *float64
	MaxInterval         *time.Duration
	MaxElapsedTime      *time.Duration
}

Jump to

Keyboard shortcuts

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