Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
Filename string
Content []byte
DestinationInfo *DestinationInfo
}
type Config ¶
type Config struct {
Sources []*SourceConfig `yaml:"sources"`
Destinations []*DestinationConfig `yaml:"destinations"`
Pollers []*PollerConfig `yaml:"pollers"`
}
type ConnectionPool ¶
type ConnectionPool struct {
// contains filtered or unexported fields
}
var DefaultConnectionPool *ConnectionPool
func NewConnectionPool ¶
func NewConnectionPool() *ConnectionPool
func (*ConnectionPool) ConnectAndLock ¶
func (cp *ConnectionPool) ConnectAndLock(cfg *SourceConfig) (IMAPClient, error)
func (*ConnectionPool) Unlock ¶
func (cp *ConnectionPool) Unlock(cfg *SourceConfig)
type DestinationConfig ¶
type DestinationInfo ¶
type DestinationInfo struct {
Config *DestinationConfig
Directory string
}
type IMAPClient ¶
type IMAPClient interface {
Login() error
Unlock()
Select(name string, readOnly bool) (*imap.MailboxStatus, error)
Search(criteria *imap.SearchCriteria) (seqNums []uint32, err error)
Fetch(seqset *imap.SeqSet, items []imap.FetchItem, ch chan *imap.Message) error
}
func NewIMAPClient ¶
func NewIMAPClient(cfg *SourceConfig, cp *ConnectionPool) (IMAPClient, error)
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
func NewPoller ¶
func NewPoller(config *PollerConfig) (*Poller, error)
func (*Poller) Poll ¶
func (p *Poller) Poll() ([]*Attachment, error)
type PollerConfig ¶
type PollerConfig struct {
SourceName string `yaml:"source"`
SourceConfig *SourceConfig
SourceDirectories []string `yaml:"sourceDirectories"`
DestinationName string `yaml:"destination"`
DestinationConfig *DestinationConfig
DestinationDirectory string `yaml:"destinationDirectory"`
Timeout time.Duration `yaml:"timeout"`
}
func (*PollerConfig) String ¶
func (cfg *PollerConfig) String() string
type SourceConfig ¶
type Uploader ¶
type Uploader struct {
}
func (*Uploader) UploadAttachments ¶
func (u *Uploader) UploadAttachments(attachments []*Attachment) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.