odfi

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

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

Cleanup deletes files on remote servers if enabled via config

func CleanupEmptyFiles

func CleanupEmptyFiles(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(logger log.Logger, cfg service.ODFICorrections, svc events.Emitter) *correctionProcessor

func CreditReconciliationEmitter

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

func PrenoteEmitter

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

func ProcessFiles

func ProcessFiles(dl *downloadedFiles, auditSaver *AuditSaver, fileProcessors Processors) error

func ReturnEmitter

func ReturnEmitter(logger log.Logger, 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(agent upload.Agent) (*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(file File) error
}

type MockProcessor

type MockProcessor struct {
	Err error
}

func (*MockProcessor) Handle

func (pc *MockProcessor) Handle(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(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, consul *consul.Client, processors Processors) (Scheduler, error)

Jump to

Keyboard shortcuts

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