Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorParamsEmpty errors.CodeError = iota + errors.MinPkgSMTP ErrorConfigValidator ErrorConfigInvalidDSN ErrorConfigInvalidNetwork ErrorConfigInvalidParams ErrorConfigInvalidHost ErrorSMTPDial ErrorSMTPClientInit ErrorSMTPClientStartTLS ErrorSMTPClientAuth ErrorSMTPClientNoop ErrorSMTPClientMail ErrorSMTPClientRcpt ErrorSMTPClientData ErrorSMTPClientWrite ErrorSMTPLineCRLF )
Variables ¶
This section is empty.
Functions ¶
func IsCodeError ¶
func IsCodeError() bool
Types ¶
type Config ¶ added in v1.5.4
type Config interface { SetHost(host string) GetHost() string SetPort(port int) GetPort() int SetUser(user string) GetUser() string SetPass(pass string) GetPass() string SetNet(mode NETMode) GetNet() NETMode SetTlsMode(mode TLSMode) GetTlsMode() TLSMode SetTls(tls libtls.Config) GetTls() libtls.Config ForceTLSSkipVerify(skip bool) IsTLSSkipVerify() bool SetTLSServerName(serverName string) GetTlSServerName() string SetStatusConfig(sts libsts.ConfigStatus) GetStatusConfig() libsts.ConfigStatus GetDsn() string }
type ConfigModel ¶ added in v1.8.1
type ConfigModel struct { DSN string `json:"dsn" yaml:"dsn" toml:"dsn" mapstructure:"dsn"` TLS libtls.Config `json:"tls,omitempty" yaml:"tls,omitempty" toml:"tls,omitempty" mapstructure:"tls,omitempty"` Status libsts.ConfigStatus `json:"status,omitempty" yaml:"status,omitempty" toml:"status,omitempty" mapstructure:"status,omitempty"` // contains filtered or unexported fields }
func (ConfigModel) RegisterDefaultTLS ¶ added in v1.8.10
func (c ConfigModel) RegisterDefaultTLS(fct func() libtls.TLSConfig)
func (ConfigModel) Validate ¶ added in v1.8.10
func (c ConfigModel) Validate() liberr.Error
type SMTP ¶
type SMTP interface { Clone() SMTP Close() Client(ctx context.Context) (*smtp.Client, liberr.Error) Check(ctx context.Context) liberr.Error Send(ctx context.Context, from string, to []string, data io.WriterTo) liberr.Error StatusInfo() (name string, release string, hash string) StatusHealth() error StatusRouter(sts libsts.RouteStatus, prefix string) }
func NewSMTP ¶
NewSMTP return a SMTP interface to operation negotiation with a SMTP server. the dsn parameter must be string like this '[user[:password]@][net[(addr)]]/tlsmode[?param1=value1¶mN=valueN]".
- params available are : ServerName (string), SkipVerify (boolean).
- tls mode acceptable are : starttls, tls, <any other value to no tls/startls>.
- net aceeptable are : tcp4, tcp6, unix.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.