worker

package
v0.0.0-...-900104f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMAPLogger

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

func (*IMAPLogger) Printf

func (l *IMAPLogger) Printf(format string, v ...interface{})

func (*IMAPLogger) Println

func (l *IMAPLogger) Println(v ...interface{})

type ReloadCmd

type ReloadCmd struct{}

func (ReloadCmd) String

func (c ReloadCmd) String() string

type StopCmd

type StopCmd struct{}

func (StopCmd) String

func (c StopCmd) String() string

type SyncCmd

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

func (SyncCmd) String

func (c SyncCmd) String() string

type UpSyncCmd

type UpSyncCmd struct {
	common.Action
	common.Answer
	// contains filtered or unexported fields
}

func (UpSyncCmd) String

func (c UpSyncCmd) String() string

type Worker

type Worker struct {
	Debug bool
	Trace bool
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(name string, account *config.AccountData, logger logz.Logger, wg *sync.WaitGroup) (*Worker, error)

func (*Worker) CmdReload

func (w *Worker) CmdReload()

func (*Worker) CmdStop

func (w *Worker) CmdStop()

func (*Worker) CmdSync

func (w *Worker) CmdSync()

func (*Worker) CmdUpSync

func (w *Worker) CmdUpSync(data common.UpsyncData)

func (*Worker) Run

func (w *Worker) Run() error

func (*Worker) Start

func (w *Worker) Start() error

func (*Worker) Sync

func (w *Worker) Sync() error

Sync is the core of the Worker action. Iterating on each mailbox, it tries to align the remote imap folders with the local content, given some contraints. It follows this steps:

  • Donwload the new messages (up to a maximum set amount)
  • Check if the messages held locally have to be updated (some flags have been changed) or deleted
  • Put the new messages in the new/ directory
  • Update the filename of the files yet known or delete them altogether

func (*Worker) Terminate

func (w *Worker) Terminate()

Jump to

Keyboard shortcuts

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