transactionforwarder

package
v0.0.0-...-44638ef Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTransactionalForwarder

func InitTransactionalForwarder()

InitTransactionalForwarder initializes the global transactional forwarder Instance

Types

type Forwarder

type Forwarder struct {
	PayloadChannel  chan TransactionalPayload
	ShutdownChannel chan ShutdownForwarder
	// contains filtered or unexported fields
}

Forwarder is a forwarder that works in transactional manner

func (*Forwarder) ProgressTransactions

func (f *Forwarder) ProgressTransactions(transactionMap map[string]transactional.PayloadTransaction)

ProgressTransactions is called on a successful payload post or when OnlyMarkTransactions is set to true. It acknowledges the actions within a transaction and completes a completed transaction.

func (*Forwarder) Start

func (f *Forwarder) Start()

Start initialize and runs the transactional forwarder.

func (*Forwarder) Stop

func (f *Forwarder) Stop()

Stop stops running the transactional forwarder.

func (*Forwarder) SubmitTransactionalIntake

func (f *Forwarder) SubmitTransactionalIntake(payload TransactionalPayload)

SubmitTransactionalIntake publishes the Payload to the PayloadChannel

type MockTransactionalForwarder

type MockTransactionalForwarder struct {
	PayloadChan chan TransactionalPayload
}

MockTransactionalForwarder is a mock implementation of the transactional forwarder

func NewMockTransactionalForwarder

func NewMockTransactionalForwarder() *MockTransactionalForwarder

NewMockTransactionalForwarder initializes the global TransactionalForwarder with a mock version, intended for testing

func (*MockTransactionalForwarder) NextPayload

NextPayload returns the next payload in the PayloadChan

func (*MockTransactionalForwarder) Start

func (mf *MockTransactionalForwarder) Start()

Start is a noop

func (*MockTransactionalForwarder) Stop

func (mf *MockTransactionalForwarder) Stop()

Stop closes the payload channel and resets the singleton init

func (*MockTransactionalForwarder) SubmitTransactionalIntake

func (mf *MockTransactionalForwarder) SubmitTransactionalIntake(payload TransactionalPayload)

SubmitTransactionalIntake receives a TransactionalPayload and keeps it in the PayloadChan to be used in assertions

type PrintingTransactionalForwarder

type PrintingTransactionalForwarder struct {
	PayloadChan chan TransactionalPayload
}

PrintingTransactionalForwarder is a implementation of the transactional forwarder that prints the payload

func NewPrintingTransactionalForwarder

func NewPrintingTransactionalForwarder() *PrintingTransactionalForwarder

NewPrintingTransactionalForwarder initializes the global PrintingTransactionalForwarder used for the agent check command

func (*PrintingTransactionalForwarder) Start

func (mf *PrintingTransactionalForwarder) Start()

Start is a noop

func (*PrintingTransactionalForwarder) Stop

func (mf *PrintingTransactionalForwarder) Stop()

Stop is a noop

func (*PrintingTransactionalForwarder) SubmitTransactionalIntake

func (mf *PrintingTransactionalForwarder) SubmitTransactionalIntake(payload TransactionalPayload)

SubmitTransactionalIntake receives a TransactionalPayload and keeps it in the PayloadChan to be used in assertions

type ShutdownForwarder

type ShutdownForwarder struct{}

ShutdownForwarder shuts down the forwarder

type TransactionalForwarder

type TransactionalForwarder interface {
	Start()
	SubmitTransactionalIntake(payload TransactionalPayload)
	Stop()
}

TransactionalForwarder encapsulates the functionality for a transactional forwarder

func GetTransactionalForwarder

func GetTransactionalForwarder() TransactionalForwarder

GetTransactionalForwarder ...

type TransactionalPayload

type TransactionalPayload struct {
	Body                 []byte
	Path                 string
	TransactionActionMap map[string]transactional.PayloadTransaction
}

TransactionalPayload contains the Payload and transactional data

Jump to

Keyboard shortcuts

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