Documentation ¶
Index ¶
- type ArchiveConfig
- type AvailableToSend
- type BindingConfig
- type BusConfig
- type BusError
- type CleanUpConfig
- type EncryptFilesConfig
- type EncryptionLog
- type EncryptionRecord
- type EncryptionRecorder
- type ExchangeConfig
- type MessageConsumer
- type MessagePayload
- type Pipeline
- type PipelineConfig
- type QueueClient
- type QueueConfig
- type SftpConfig
- type TasksConfig
- type TransferFilesPayload
- type TransferLog
- func (t TransferLog) Create(txn *gorm.DB, rec *TransferRecord) error
- func (t TransferLog) FileAlreadySent(txn *gorm.DB, hash string, remoteHost string) (bool, error)
- func (t TransferLog) RecordError(txn *gorm.DB, rec *TransferRecord) error
- func (t TransferLog) Update(txn *gorm.DB, rec *TransferRecord) error
- type TransferRecord
- type TransferRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveConfig ¶
ArchiveConfig configuration for the archive task
type AvailableToSend ¶
type AvailableToSend struct {
// contains filtered or unexported fields
}
AvailableToSend Represents a row of files which have been encrypted and are available to send
type BindingConfig ¶
BindingConfig Queue/Exchange Bindings
type BusConfig ¶
type BusConfig struct { User string Password string Host string Port string Vhost string Exchanges []*ExchangeConfig Queues []*QueueConfig `json:"queues"` }
BusConfig RabbitMQ configuration definition
func (BusConfig) ConnectionString ¶
ConnectionString Format an AMQP Connection String
type CleanUpConfig ¶
CleanUpConfig defines the configuration for the cleanup task
type EncryptFilesConfig ¶
type EncryptFilesConfig struct { SrcDir string `json:"srcDir"` OutputDir string `json:"outputDir"` Providers map[string]crypto.ProviderConfig `json:"providers"` Enabled bool `json:"enabled"` }
EncryptFilesConfig is the configuration requriements for the encryptFiles task
type EncryptionLog ¶
EncryptionLog Stores a database log
func NewEncryptionRecorder ¶
func NewEncryptionRecorder(Conn *gorm.DB, log *log.Entry) *EncryptionLog
NewEncryptionRecorder provides a service which records transfer records in the database
func (*EncryptionLog) Create ¶
func (t *EncryptionLog) Create(txn *gorm.DB, rec *EncryptionRecord) error
Create Creates an encryption record
func (*EncryptionLog) GetByHash ¶
func (t *EncryptionLog) GetByHash(hash string) (*EncryptionRecord, error)
GetByHash Gets a record for a given files hash
func (*EncryptionLog) Update ¶
func (t *EncryptionLog) Update(txn *gorm.DB, rec *EncryptionRecord) error
Update Updates a record
type EncryptionRecord ¶
type EncryptionRecord struct { gorm.Model LocalFileName string LocalFilePath string LocalFileSize int64 RecipientKey string SigningKey string LocalFileHash string `gorm:"primary_key"` EncryptedFileHash string CorrelationID string }
EncryptionRecord Maps to a row in the FileTransfers table
func (EncryptionRecord) TableName ¶
func (EncryptionRecord) TableName() string
TableName sets the table name to TransferRecord
type EncryptionRecorder ¶
type EncryptionRecorder interface { Create(txn *gorm.DB, rec *EncryptionRecord) error GetByHash(hash string) (*EncryptionRecord, error) }
EncryptionRecorder provides a mechanism to update the transfer status
type ExchangeConfig ¶
ExchangeConfig RabbbitMQ Exchange configuration
type MessageConsumer ¶
type MessageConsumer struct { Connection *amqp.Connection ConsumerChannel *amqp.Channel Shutdown bool // contains filtered or unexported fields }
MessageConsumer holds the configuration, current connection and open channel
func NewConsumer ¶
func NewConsumer(config *BusConfig, log *log.Entry) *MessageConsumer
NewConsumer provides an instance of MessageConsumer
func (*MessageConsumer) Close ¶
func (c *MessageConsumer) Close() error
Close Closes the connection to the rabbitmq server
func (*MessageConsumer) Configure ¶
func (c *MessageConsumer) Configure(ch *amqp.Channel) (err error)
Configure Creates the Exchange and Queue
func (*MessageConsumer) Connect ¶
func (c *MessageConsumer) Connect() (*amqp.Connection, error)
Connect Establishes a connection to rabbitmq
type MessagePayload ¶
type MessagePayload struct { Task string `json:"task"` StartDate string `json:"start_date"` CorrelationID string `json:"correlationId"` }
MessagePayload represents the message content in a TransferFilesPayload from the message bus
type Pipeline ¶
type Pipeline interface { StartListener(listenerError chan error) Execute(string) []error Close() error // contains filtered or unexported methods }
Pipeline is an implementation of a pipeline
type PipelineConfig ¶
type PipelineConfig struct { Database mysql.Config Rabbitmq *BusConfig Tasks *TasksConfig }
PipelineConfig defines the required arguements for the pipeline
type QueueClient ¶
QueueClient Consumes a message for the pipeline
type QueueConfig ¶
type QueueConfig struct { Name string Durable bool `json:"durable"` DeleteOnUnused bool `json:"deleteOnUnused"` Exclusive bool `json:"exclusive"` NoWait bool `json:"noWait"` Args string `json:"args"` Bindings []BindingConfig `json:"bindings"` }
QueueConfig RabbitMQ Queue definition
type SftpConfig ¶
type SftpConfig struct { RemoteDir string `json:"remoteDir"` LocalDir string `json:"localDir"` Sftp sftp.Endpoint `json:"sftp"` Enabled bool `json:"enabled"` }
SftpConfig Required Params for transferring to or from an SFTP Server
type TasksConfig ¶
type TasksConfig struct { GetFilesFromBFP *SftpConfig `json:"getFilesFromBFP"` CleanBFP *SftpConfig `json:"cleanBFP"` EncryptFiles *EncryptFilesConfig `json:"encryptFiles"` SftpFilesToANZ *SftpConfig `json:"sftpFilesToANZ"` SftpFilesToPx *SftpConfig `json:"sftpFilesToPx"` SftpFilesToBNZ *SftpConfig `json:"sftpFilesToBNZ"` ArchiveTransferred *ArchiveConfig `json:"archiveTransferred"` CleanDirtyFiles *CleanUpConfig }
TasksConfig Configuration
type TransferFilesPayload ¶
type TransferFilesPayload struct { MessageType []string Message MessagePayload }
TransferFilesPayload represents the payload received from the message bus
type TransferLog ¶
TransferLog Stores a database log
func NewTransferRecorder ¶
func NewTransferRecorder(Conn *gorm.DB, log *log.Entry) *TransferLog
NewTransferRecorder provides a service which records transfer records in the database
func (TransferLog) Create ¶
func (t TransferLog) Create(txn *gorm.DB, rec *TransferRecord) error
Create Creates a TransferRecord
func (TransferLog) FileAlreadySent ¶
FileAlreadySent Determines if a file has been
func (TransferLog) RecordError ¶
func (t TransferLog) RecordError(txn *gorm.DB, rec *TransferRecord) error
RecordError Updates the transfer record in the database to record the error message
func (TransferLog) Update ¶
func (t TransferLog) Update(txn *gorm.DB, rec *TransferRecord) error
Update updates the record
type TransferRecord ¶
type TransferRecord struct { gorm.Model LocalFileName string LocalFilePath string LocalFileSize int64 RemoteFileName string RemoteFilePath string RemoteFileSize int64 RecipientName string SenderName string LocalFileHash string `gorm:"primary_key"` TransferredFileHash string LocalHostID string RemoteHost string `gorm:"primary_key"` TransferStart time.Time TransferEnd time.Time TransferErrors string CorrelationID string }
TransferRecord Maps to a row in the FileTransfers table
func (TransferRecord) TableName ¶
func (TransferRecord) TableName() string
TableName sets the table name to TransferRecord