Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRecordingClient ¶ added in v1.30.0
func NewRecordingClient(opts ...ClientOption) (*Client, *Outbox)
NewRecordingClient returns a Client that sends nothing and records every email and text message in the returned Outbox. It makes no network call and needs no credentials. WithEmailSender and WithSenderName set the From of the recorded emails.
Types ¶
type Attachment ¶
type Client ¶
type Client struct {
Region string
AccessKeyID string
SecretAccessKey string
EmailSender string
SenderName string
PushNotificationARN string
// contains filtered or unexported fields
}
Client contains the AWS configuration and methods
func NewClient ¶
func NewClient(ctx context.Context, region, accessKey, secretKey string, opts ...ClientOption) (*Client, error)
NewClient creates and returns a new AWS Client from configuration
type ClientOption ¶
type ClientOption func(*Client)
ClientOption defines function type for client options
func WithEmailSender ¶
func WithEmailSender(emailSender string) ClientOption
WithEmailSender sets the email sender
func WithPushNotificationARN ¶
func WithPushNotificationARN(arn string) ClientOption
WithPushNotificationARN sets the push notification ARN
func WithRefreshTTL ¶
func WithRefreshTTL(ttl int64) ClientOption
WithRefreshTTL sets a custom refresh TTL in seconds
func WithSenderName ¶
func WithSenderName(senderName string) ClientOption
WithSenderName sets the sender name
func WithSessionTTL ¶
func WithSessionTTL(ttl int64) ClientOption
WithSessionTTL sets a custom session TTL in seconds
type Email ¶ added in v1.8.0
type Email struct {
Recipients []string
Subject string
HTMLBody string
TextBody string
Attachments []Attachment
}
type Outbox ¶ added in v1.30.0
type Outbox struct {
// contains filtered or unexported fields
}
Outbox holds what a recording client was asked to send, in order. It is safe for concurrent use.
func (*Outbox) Emails ¶ added in v1.30.0
Emails returns a copy of the recorded emails, oldest first.