Documentation
¶
Overview ¶
Package config provides configuration management for imapsync.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSrcServerRequired = errors.New("source server is required") ErrSrcUserRequired = errors.New("source user is required") ErrSrcPassRequired = errors.New("source password is required") ErrDstServerRequired = errors.New("destination server is required") ErrDstUserRequired = errors.New("destination user is required") ErrDstPassRequired = errors.New("destination password is required") )
Sentinel errors returned by Config.validate. Callers can match on these with errors.Is to distinguish missing fields from other failures.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Src Credentials `json:"src" yaml:"src"`
Dst Credentials `json:"dst" yaml:"dst"`
Map []DirectoryMapping `json:"map" yaml:"map"`
RateLimit RateLimit `json:"rate_limit" yaml:"rate_limit"`
Workers int `json:"-" yaml:"-"`
}
Config holds the entire configuration for the application.
type Credentials ¶
type Credentials struct {
Label string `json:"label" yaml:"label"` // Human-readable label for the server
Server string `json:"server" yaml:"server"` // Server address (host:port)
User string `json:"user" yaml:"user"` // Username
Pass string `json:"pass" yaml:"pass"` // Password
}
Credentials holds IMAP connection data.
type DirectoryMapping ¶
type DirectoryMapping struct {
Source string `json:"src" yaml:"src"` // Source folder name
Destination string `json:"dst" yaml:"dst"` // Destination folder name
}
DirectoryMapping holds source and destination folder names.
type RateLimit ¶ added in v1.1.0
type RateLimit struct {
DownBPS int `json:"down_bps" yaml:"down_bps"`
UpBPS int `json:"up_bps" yaml:"up_bps"`
MaxConnections int `json:"max_connections" yaml:"max_connections"`
}
RateLimit caps client-side throughput. Zero values mean "unlimited" and the corresponding limiter is not constructed at all.
MaxConnections caps the simultaneous IMAP sessions per side. Many providers enforce this server-side (Gmail = 15) — exceeding it earns a temporary ban.
Click to show internal directories.
Click to hide internal directories.