Documentation
¶
Index ¶
- func AddFileTransferConfigRoutes(logger log.Logger, svc *admin.Server, repo Repository)
- func GetConfigs(logger log.Logger, repo Repository) http.HandlerFunc
- type Agent
- type Config
- type CutoffTime
- type FTPConfig
- type FTPTransferAgent
- func (agent *FTPTransferAgent) Close() error
- func (agent *FTPTransferAgent) Delete(path string) error
- func (agent *FTPTransferAgent) GetInboundFiles() ([]File, error)
- func (agent *FTPTransferAgent) GetReturnFiles() ([]File, error)
- func (agent *FTPTransferAgent) InboundPath() string
- func (agent *FTPTransferAgent) OutboundPath() string
- func (agent *FTPTransferAgent) ReturnPath() string
- func (agent *FTPTransferAgent) UploadFile(f File) error
- type File
- type Repository
- type SFTPConfig
- type SFTPTransferAgent
- func (a *SFTPTransferAgent) Close() error
- func (agent *SFTPTransferAgent) Delete(path string) error
- func (agent *SFTPTransferAgent) GetInboundFiles() ([]File, error)
- func (agent *SFTPTransferAgent) GetReturnFiles() ([]File, error)
- func (agent *SFTPTransferAgent) InboundPath() string
- func (agent *SFTPTransferAgent) OutboundPath() string
- func (a *SFTPTransferAgent) Ping() error
- func (agent *SFTPTransferAgent) ReturnPath() string
- func (agent *SFTPTransferAgent) UploadFile(f File) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileTransferConfigRoutes ¶
func AddFileTransferConfigRoutes(logger log.Logger, svc *admin.Server, repo Repository)
AddFileTransferConfigRoutes registers the admin HTTP routes for modifying file-transfer (uploading) configs.
func GetConfigs ¶
func GetConfigs(logger log.Logger, repo Repository) http.HandlerFunc
GetConfigs returns all configurations (i.e. FTP, cutoff times, file-transfer configs with passwords masked. (e.g. 'p******d')
Types ¶
type Agent ¶
type Agent interface { GetInboundFiles() ([]File, error) GetReturnFiles() ([]File, error) UploadFile(f File) error Delete(path string) error InboundPath() string OutboundPath() string ReturnPath() string Close() error }
Agent represents an interface for uploading and retrieving ACH files from a remote service.
func New ¶
func New(_type string, cfg *Config, repo Repository) (Agent, error)
New returns an implementation of a Agent which is used to upload files to a remote server.
This function reads ACH_FILE_TRANSFERS_ROOT_CAFILE for a file with additional root certificates to be used in all secured connections.
type CutoffTime ¶
type CutoffTime struct { RoutingNumber string Cutoff int // 24-hour time value (0000 to 2400) Loc *time.Location // timezone cutoff is in (usually America/New_York) }
CutoffTime represents the time of a banking day when all ACH files need to be uploaded in order to be processed for that day. Files which miss the cutoff time won't be processed until the next day.
TODO(adam): How to handle multiple CutoffTime's for Same Day ACH?
func (*CutoffTime) Diff ¶
func (c *CutoffTime) Diff(when time.Time) time.Duration
diff returns the time.Duration between when and the CutoffTime A negative value will be returned if the cutoff has already passed
func (CutoffTime) MarshalJSON ¶
func (c CutoffTime) MarshalJSON() ([]byte, error)
type FTPTransferAgent ¶
type FTPTransferAgent struct {
// contains filtered or unexported fields
}
FTPTransferAgent is an FTP implementation of a Agent
func (*FTPTransferAgent) Close ¶
func (agent *FTPTransferAgent) Close() error
func (*FTPTransferAgent) Delete ¶
func (agent *FTPTransferAgent) Delete(path string) error
func (*FTPTransferAgent) GetInboundFiles ¶
func (agent *FTPTransferAgent) GetInboundFiles() ([]File, error)
func (*FTPTransferAgent) GetReturnFiles ¶
func (agent *FTPTransferAgent) GetReturnFiles() ([]File, error)
func (*FTPTransferAgent) InboundPath ¶
func (agent *FTPTransferAgent) InboundPath() string
func (*FTPTransferAgent) OutboundPath ¶
func (agent *FTPTransferAgent) OutboundPath() string
func (*FTPTransferAgent) ReturnPath ¶
func (agent *FTPTransferAgent) ReturnPath() string
func (*FTPTransferAgent) UploadFile ¶
func (agent *FTPTransferAgent) UploadFile(f File) error
uploadFile saves the content of File at the given filename in the OutboundPath directory
The File's contents will always be closed
type File ¶
type File struct { Filename string Contents io.ReadCloser }
type Repository ¶
type Repository interface { GetConfigs() ([]*Config, error) GetCutoffTimes() ([]*CutoffTime, error) GetFTPConfigs() ([]*FTPConfig, error) GetSFTPConfigs() ([]*SFTPConfig, error) Close() error }
func NewRepository ¶
func NewRepository(db *sql.DB, dbType string) Repository
type SFTPConfig ¶
type SFTPTransferAgent ¶
type SFTPTransferAgent struct {
// contains filtered or unexported fields
}
func (*SFTPTransferAgent) Close ¶
func (a *SFTPTransferAgent) Close() error
func (*SFTPTransferAgent) Delete ¶
func (agent *SFTPTransferAgent) Delete(path string) error
func (*SFTPTransferAgent) GetInboundFiles ¶
func (agent *SFTPTransferAgent) GetInboundFiles() ([]File, error)
func (*SFTPTransferAgent) GetReturnFiles ¶
func (agent *SFTPTransferAgent) GetReturnFiles() ([]File, error)
func (*SFTPTransferAgent) InboundPath ¶
func (agent *SFTPTransferAgent) InboundPath() string
func (*SFTPTransferAgent) OutboundPath ¶
func (agent *SFTPTransferAgent) OutboundPath() string
func (*SFTPTransferAgent) Ping ¶
func (a *SFTPTransferAgent) Ping() error
func (*SFTPTransferAgent) ReturnPath ¶
func (agent *SFTPTransferAgent) ReturnPath() string
func (*SFTPTransferAgent) UploadFile ¶
func (agent *SFTPTransferAgent) UploadFile(f File) error
uploadFile saves the content of File at the given filename in the OutboundPath directory
The File's contents will always be closed