odfi

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(ctx context.Context, logger log.Logger, agent upload.Agent, dl *downloadedFiles) error

Cleanup deletes files on remote servers if enabled via config

func CleanupEmptyFiles

func CleanupEmptyFiles(ctx context.Context, logger log.Logger, agent upload.Agent, dl *downloadedFiles) error

CleanupEmptyFiles deletes empty ACH files if file is older than value in config

func CorrectionEmitter

func CorrectionEmitter(cfg service.ODFICorrections, svc events.Emitter) *correctionProcessor

func CreditReconciliationEmitter

func CreditReconciliationEmitter(cfg service.ODFIReconciliation, svc events.Emitter) *creditReconciliation

func IncomingEmitter added in v0.16.0

func IncomingEmitter(cfg service.ODFIIncoming, recon service.ODFIReconciliation, svc events.Emitter) *incomingEmitter

func PrenoteEmitter

func PrenoteEmitter(cfg service.ODFIPrenotes, svc events.Emitter) *prenoteEmitter

func ProcessFiles

func ProcessFiles(ctx context.Context, logger log.Logger, dl *downloadedFiles, alerters alerting.Alerters, auditSaver *AuditSaver, validation ach.ValidateOpts, fileProcessors Processors, agent upload.Agent) error

func ReturnEmitter

func ReturnEmitter(cfg service.ODFIReturns, svc events.Emitter) *returnEmitter

Types

type AuditSaver added in v0.8.0

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

type Downloader

type Downloader interface {
	CopyFilesFromRemote(ctx context.Context, agent upload.Agent, shard *service.Shard) (*downloadedFiles, error)
}

func NewDownloader

func NewDownloader(logger log.Logger, cfg service.ODFIStorage) (Downloader, error)

type File

type File struct {
	Filepath string
	ACHFile  *ach.File
}

type FileProcessor

type FileProcessor interface {
	Type() string

	// Handle processes an ACH file with whatever logic is implemented
	Handle(ctx context.Context, logger log.Logger, file File) error
}

type MockProcessor

type MockProcessor struct {
	HandledFile *File
	Err         error
}

func (*MockProcessor) Handle

func (pc *MockProcessor) Handle(_ context.Context, logger log.Logger, file File) error

func (*MockProcessor) Type

func (pc *MockProcessor) Type() string

type MockScheduler

type MockScheduler struct {
	Err error
}

func (*MockScheduler) RegisterRoutes

func (*MockScheduler) RegisterRoutes(_ *admin.Server)

func (*MockScheduler) Shutdown

func (*MockScheduler) Shutdown()

func (*MockScheduler) Start

func (s *MockScheduler) Start() error

type PeriodicScheduler

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

func (*PeriodicScheduler) RegisterRoutes

func (s *PeriodicScheduler) RegisterRoutes(svc *admin.Server)

func (*PeriodicScheduler) Shutdown

func (s *PeriodicScheduler) Shutdown()

func (*PeriodicScheduler) Start

func (s *PeriodicScheduler) Start() error

type Processors

type Processors []FileProcessor

func SetupProcessors

func SetupProcessors(pcs ...FileProcessor) Processors

func (Processors) HandleAll

func (pcs Processors) HandleAll(ctx context.Context, logger log.Logger, file File) error

type Scheduler

type Scheduler interface {
	Start() error
	Shutdown()
	RegisterRoutes(svc *admin.Server)
}

func NewPeriodicScheduler

func NewPeriodicScheduler(logger log.Logger, cfg *service.Config, processors Processors) (Scheduler, error)

Jump to

Keyboard shortcuts

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