internal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(logger logger.Interface, db *gorm.DB) error

Migrate will run migration for all tables

func NewGormLogAdapter

func NewGormLogAdapter(logger logger.Logger) glogger.Interface

NewGormLogAdapter returns a new Logger that implements the gorm Logger interface

Types

type MessageProcessor

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

func NewMessageProcessor

func NewMessageProcessor(opts MessageProcessorOpts) (*MessageProcessor, error)

NewMessageProcessor will create a new processor for a given customer id

func (*MessageProcessor) Start

func (p *MessageProcessor) Start() error

Start will start processing messages

func (*MessageProcessor) Stop

func (p *MessageProcessor) Stop() error

Stop will stop processing messages

type MessageProcessorOpts

type MessageProcessorOpts struct {
	Logger          logger.Logger
	CompanyID       string
	Provider        Provider
	NatsConnection  *nats.Conn
	DumpMessagesDir string
	TraceNats       bool
	ConsumerPrefix  string
}

MessageProcessorOpts is the options for the message processor

type Provider added in v1.0.0

type Provider interface {
	// Start the provider and return an error or nil if ok
	Start() error
	// Stop the provider and return an error or nil if ok
	Stop() error
	// Process data received and return an error or nil if processed ok
	Process(data datatypes.ChangeEventPayload) error
	// Migrate will tell the provider to do any migration work and return an error or nil if ok
	Migrate() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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