Documentation
¶
Overview ¶
Package email provides a TrackedClient decorator that wraps an email client with automatic request timing and tracking capabilities, plus validation utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateSendRequest ¶
func ValidateSendRequest(req email.SendRequest) error
ValidateSendRequest validates a SendRequest and returns an error if invalid.
Types ¶
type TrackedClient ¶
type TrackedClient struct {
// contains filtered or unexported fields
}
TrackedClient wraps an email.Client and automatically tracks all requests. This implements the Decorator pattern.
func NewTrackedClient ¶
func NewTrackedClient(client email.Client, tracker email.Tracker, executionID string) *TrackedClient
NewTrackedClient creates a TrackedClient that wraps the given client and tracks requests.
func (*TrackedClient) Send ¶
func (tc *TrackedClient) Send(functionID string, req email.SendRequest) (*email.SendResponse, error)
Send sends an email with automatic tracking. It measures duration, captures request/response data, and tracks the result.
func (*TrackedClient) SendWithTracking ¶
func (tc *TrackedClient) SendWithTracking(functionID string, req email.SendRequest) TrackedSendResult
SendWithTracking sends an email and returns both the response and tracking data. This is useful when you need access to the tracking information.
type TrackedSendResult ¶
type TrackedSendResult struct {
Response *email.SendResponse
TrackData email.TrackRequest
Error error
}
TrackedSendResult contains both the response and tracking information.