processor

package
v0.0.0-...-1bd4e9b Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Err error
	*Processor
}

type Processor

type Processor struct {
	Name                 string
	RabbitConn           *amqp.Connection
	RabbitRoutingKey     string
	RabbitChannels       []RabbitChannel
	OutboundMsgChan      chan *models.OutboundMessage
	Config               *config.Configuration
	PubSubProject        string
	PubSubSubscriptionId string
	PubSubClient         *pubsub.Client
	PubSubSubscription   *pubsub.Subscription

	ErrChan chan Error
	Logger  *zap.SugaredLogger
	Context context.Context
	Cancel  context.CancelFunc
	// contains filtered or unexported fields
}

func NewEqReceiptProcessor

func NewEqReceiptProcessor(ctx context.Context, appConfig *config.Configuration, errChan chan Error) (*Processor, error)

func NewProcessor

func NewProcessor(ctx context.Context,
	appConfig *config.Configuration,
	pubSubProject string,
	pubSubSubscription string,
	routingKey string,
	messageConverter messageConverter,
	messageUnmarshaller messageUnmarshaller, errChan chan Error) (*Processor, error)

func (*Processor) CloseRabbit

func (p *Processor) CloseRabbit(errOk bool)

func (*Processor) Consume

func (p *Processor) Consume()

func (*Processor) Initialise

func (p *Processor) Initialise(ctx context.Context) (err error)

func (*Processor) Process

func (p *Processor) Process(_ context.Context, msg *pubsub.Message)

func (*Processor) Publish

func (p *Processor) Publish(ctx context.Context, channel RabbitChannel)

func (*Processor) ReportError

func (p *Processor) ReportError(err error)

func (*Processor) Restart

func (p *Processor) Restart(ctx context.Context)

func (*Processor) Stop

func (p *Processor) Stop()

func (*Processor) StopPublishers

func (p *Processor) StopPublishers()

type RabbitChannel

type RabbitChannel interface {
	Close() error
	Tx() error
	TxCommit() error
	TxRollback() error
	NotifyClose(chan *amqp.Error) chan *amqp.Error
	Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
}

Jump to

Keyboard shortcuts

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