service

package
v0.0.0-...-de95c55 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Consumer           *consumer.GroupConsumer
	Producer           *producer.Producer
	PpSchema           string
	Client             *http.Client
	InitialOffset      int64
	HandleError        func(err error, offset int64, str interface{}) error
	Topic              string
	Retry              *resilience.ServiceRetry
	IsErrorConsumer    bool
	BrokerAddr         []string
	APIKey             string
	PaymentsAPIURL     string
	DAO                dao.DAO
	TranCollection     string
	ProdCollection     string
	ProductMap         *config.ProductMap
	Payments           payment.Fetcher
	Transformer        transformer.Transformer
	StopAtOffset       int64
	SkipGoneResource   bool
	SkipGoneResourceId string
}

Service represents service config for payment-reconciliation-consumer

func New

func New(consumerTopic, consumerGroupName string, cfg *config.Config, retry *resilience.ServiceRetry) (*Service, error)

New creates a new instance of service with a given consumerGroup name, consumerTopic, throttleRate and payment-reconciliation-consumer config

func (*Service) MaskSensitiveFields

func (svc *Service) MaskSensitiveFields(payment *data.PaymentResponse)

We need a function to mask potentially sensitive data fields in the event it's a secure application. Currently there are product types/codes registered against these applications.

func (*Service) Shutdown

func (svc *Service) Shutdown(topic string)

Shutdown closes all producers and consumers for this service

func (*Service) Start

func (svc *Service) Start(wg *sync.WaitGroup, c chan os.Signal)

Start begins the service - Messages are consumed from the payment-processed topic

Jump to

Keyboard shortcuts

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