Versions in this module Expand all Collapse all v1 v1.5.2 Feb 19, 2020 Changes in this version + const BackendStateError + const BackendStateInitialized + const BackendStateNew + const BackendStateRunning + const BackendStateShuttered + const GuerrillaDBAndRedisBatchMax + const GuerrillaDBAndRedisBatchTimeout + var BackendResultOK = NewResult("200 OK") + var ErrProcessorNotFound error + var NoSuchUser = RcptError(errors.New("no such user")) + var QuotaExceeded = RcptError(errors.New("quota exceeded")) + var RedisDialer redisDial + var StorageError = RcptError(errors.New("storage error")) + var StorageNotAvailable = RcptError(errors.New("storage not available")) + var StorageTimeout = RcptError(errors.New("storage timeout")) + var StorageTooBusy = RcptError(errors.New("storage too busy")) + var Svc *service + var UserSuspended = RcptError(errors.New("user suspended")) + func Compress(stringArguments ...string) string + func Log() log.Logger + func MD5Hex(stringArguments ...string) string + func ParseHeaders(mailData string) map[string]string + type Backend interface + Initialize func(BackendConfig) error + Process func(*mail.Envelope) Result + Reinitialize func() error + Shutdown func() error + Start func() error + ValidateRcpt func(e *mail.Envelope) RcptError + func New(backendConfig BackendConfig, l log.Logger) (Backend, error) + type BackendConfig map[string]interface + type BackendGateway struct + State backendState + func (gw *BackendGateway) Initialize(cfg BackendConfig) error + func (gw *BackendGateway) Process(e *mail.Envelope) Result + func (gw *BackendGateway) Reinitialize() error + func (gw *BackendGateway) Shutdown() error + func (gw *BackendGateway) Start() error + func (gw *BackendGateway) ValidateRcpt(e *mail.Envelope) RcptError + type BaseConfig interface + type DataCompressor struct + Data *bytes.Buffer + ExtraHeaders []byte + Pool *sync.Pool + func (c *DataCompressor) String() string + type Decorator func(Processor) Processor + func Compressor() Decorator + func Debugger() Decorator + func GuerrillaDbRedis() Decorator + func Hasher() Decorator + func Header() Decorator + func HeadersParser() Decorator + func Redis() Decorator + func SQL() Decorator + type DefaultProcessor struct + func (w DefaultProcessor) Process(e *mail.Envelope, task SelectTask) (Result, error) + type Errors []error + func (e Errors) Error() string + type GatewayConfig struct + SaveProcess string + TimeoutSave string + TimeoutValidateRcpt string + ValidateProcess string + WorkersSize int + type GuerrillaDBAndRedisBackend struct + type HeaderConfig struct + PrimaryHost string + type InitializeWith func(backendConfig BackendConfig) error + func (i InitializeWith) Initialize(backendConfig BackendConfig) error + type NoopProcessor struct + type ProcessWith func(*mail.Envelope, SelectTask) (Result, error) + func (f ProcessWith) Process(e *mail.Envelope, task SelectTask) (Result, error) + type Processor interface + Process func(*mail.Envelope, SelectTask) (Result, error) + func Decorate(c Processor, ds ...Decorator) Processor + type ProcessorConstructor func() Decorator + type RcptError error + type RedisConn interface + Close func() error + Do func(commandName string, args ...interface{}) (reply interface{}, err error) + type RedisDialOption struct + type RedisMockConn struct + func (m *RedisMockConn) Close() error + func (m *RedisMockConn) Do(commandName string, args ...interface{}) (reply interface{}, err error) + type RedisProcessor struct + type RedisProcessorConfig struct + RedisExpireSeconds int + RedisInterface string + type Result interface + Code func() int + func NewResult(r ...interface{}) Result + type SQLProcessor struct + type SQLProcessorConfig struct + DSN string + Driver string + MaxConnLifetime string + MaxIdleConns int + MaxOpenConns int + PrimaryHost string + SQLInsert string + SQLValues string + Table string + type SelectTask int + const TaskSaveMail + const TaskValidateRcpt + func (o SelectTask) String() string + type ShutdownWith func() error + func (s ShutdownWith) Shutdown() error