27 lines
762 B
Go
27 lines
762 B
Go
|
|
package smtp
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"code.nochebuena.dev/einherjar/contracts/logging"
|
||
|
|
"code.nochebuena.dev/einherjar/contracts/observability"
|
||
|
|
)
|
||
|
|
|
||
|
|
type noopClient struct {
|
||
|
|
logger logging.Logger
|
||
|
|
}
|
||
|
|
|
||
|
|
func (n *noopClient) OnInit() error { return nil }
|
||
|
|
func (n *noopClient) OnStart() error { return nil }
|
||
|
|
func (n *noopClient) OnStop() error { return nil }
|
||
|
|
|
||
|
|
func (n *noopClient) Name() string { return "smtp" }
|
||
|
|
func (n *noopClient) Priority() observability.Level { return observability.LevelDegraded }
|
||
|
|
|
||
|
|
func (n *noopClient) HealthCheck(_ context.Context) error { return nil }
|
||
|
|
|
||
|
|
func (n *noopClient) Send(_ context.Context, msg Message) error {
|
||
|
|
n.logger.Warn("smtp: no-op send, message discarded", "subject", msg.Subject, "to", msg.To)
|
||
|
|
return nil
|
||
|
|
}
|