awskit

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 12 Imported by: 0

README

awskit

go awskit

Documentation

Index

Constants

View Source
const (
	// Subject is the subject line for the email
	Subject = "Amazon SES Test (AWS SDK for Go)"

	// HTMLBody is the HTML body for the email
	HTMLBody = "<h1>Amazon SES Test Email (AWS SDK for Go)</h1><p>This email was sent with " +
		"<a href='https://aws.amazon.com/ses/'>Amazon SES</a> using the " +
		"<a href='https://aws.amazon.com/sdk-for-go/'>AWS SDK for Go</a>.</p>"

	// TextBody is the email body for recipients with non-HTML email clients
	TextBody = "This email was sent with Amazon SES using the AWS SDK for Go."

	// CharSet is the character encoding for the email
	CharSet = "UTF-8"
)
View Source
const (
	// SenderIDSMSAttribute a custom name that's displayed as the message sender on the receiving device.
	SenderIDSMSAttribute = "SenderID"
	// MaxPriceSMSAttribute a maximum price in USD that you are willing to pay to send the message.
	MaxPriceSMSAttribute = "MaxPrice"
	// MessageTypeSMSAttribute a SMS type, can be either Promotional or Transactional.
	MessageTypeSMSAttribute = "MessageType"

	// Promotional message type used for promotional purposes that are noncritical, won't be delivered
	// to DND (Do Not Disturb) numbers.
	Promotional MessageType = "Promotional"
	// Transactional message type used for transactional purposes which includes critical messages as multi-factor
	// authentication. This message type might be more expensive than Promotional message type. Will be delivered to
	// to DND numbers.
	Transactional MessageType = "Transactional"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSKit

type AWSKit struct {
	// contains filtered or unexported fields
}

func New

func New() (*AWSKit, error)

func (*AWSKit) SendEMail

func (ak *AWSKit) SendEMail(ctx context.Context, msg *EMailMsg) (*string, error)

func (*AWSKit) SendSMS

func (ak *AWSKit) SendSMS(ctx context.Context, msg *SMSMsg) (*string, error)

SendSMS message to the given message to the receiver mobile phone number

func (*AWSKit) UploadBuf

func (ak *AWSKit) UploadBuf(bucketName string, objectKey string, buf []byte, size int64, contentType string) error

func (*AWSKit) UploadFile

func (ak *AWSKit) UploadFile(bucketName string, objectKey string, fileName string) error

type EMailMsg

type EMailMsg struct {
	Sender    string
	Recipient string
	Subject   string
	HTMLBody  string
	TextBody  string
	CharSet   string // Default is UTF-8
}

func (*EMailMsg) IsValid

func (em *EMailMsg) IsValid() bool

type MessageType

type MessageType string

MessageType SNS SMS type

func (MessageType) IsValid

func (mt MessageType) IsValid() bool

IsValid returns true if the message type is either transactional or promotional used to validate that a valid message type is being provided.

func (MessageType) String

func (mt MessageType) String() string

String returns message type string value

type SMSMsg

type SMSMsg struct {
	SenderID    string      // Default ""
	MaxPrice    float32     // Default 0.05
	MessageType MessageType // Default Transactional
	Content     string      //
	Recipient   string      // E.164
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL