filexfr

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileChk

type FileChk func(fileContents string, fileName string) (bool, jobs.JSONstr, []jobs.BatchInput_t, string, string, string)

FileChk is the type for file checking functions

type FileTypeMapping

type FileTypeMapping struct {
	Path string `json:"path"` // The file path pattern to match
	Type string `json:"type"` // The corresponding file type
}

FileTypeMapping represents a single file type mapping from the JSON configuration. It maps a file path pattern to a specific file type.

type FileXfrConfig

type FileXfrConfig struct {
	MaxObjectIDLength int
	IncomingBucket    string
	FailedBucket      string
}

FileXfrConfig holds configuration for file transfer operations

type FileXfrServer

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

FileXfrServer handles file transfer operations

func NewFileXfrServer

func NewFileXfrServer(jobManager *jobs.JobManager, objStore objstore.ObjectStore, queries batchsqlc.Querier, config FileXfrConfig, logger *logharbour.Logger) *FileXfrServer

NewFileXfrServer creates a new FileXfrServer with the given configuration

func (*FileXfrServer) BulkfileinProcess

func (fxs *FileXfrServer) BulkfileinProcess(file, filename, filetype string) error

BulkfileinProcess handles the processing of incoming batch files

func (*FileXfrServer) RegisterFileChk

func (fxs *FileXfrServer) RegisterFileChk(fileType string, fileChkFn FileChk) error

RegisterFileChk allows applications to register a file checking function for a specific file type. Each file type can only have one registered file checking function. Attempting to register a second function for the same file type will result in an error.

type Infiled

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

Infiled represents the Infiled daemon. It contains the configuration, a reference to the FileXfrServer, and a map to track processed files.

func NewInfiled

func NewInfiled(config InfiledConfig, fxs *FileXfrServer, logger *logharbour.Logger) (*Infiled, error)

NewInfiled creates and returns a new Infiled instance. It initializes the Infiled with the provided configuration and FileXfrServer.

func (*Infiled) Run

func (i *Infiled) Run() error

Run starts the Infiled daemon. It runs in an infinite loop, processing file mappings at regular intervals.

type InfiledConfig

type InfiledConfig struct {
	WatchDirs     []string          // List of directories to monitor for incoming files
	FileTypeMap   []FileTypeMapping // Slice of file type mappings
	SleepInterval time.Duration     // Duration to wait between processing cycles
	FileAgeSecs   int               // Minimum age (in seconds) of files to be processed
}

InfiledConfig holds the configuration for the Infiled daemon. It includes settings for directories to watch, file type mappings, and timing parameters.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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