api

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooManyRequests = errors.New("too many requests")

	ErrNotFound      = errors.New("email not found")
	ErrInvalidInput  = errors.New("invalid input")
	ErrQueryNotMatch = errors.New("query does not match with next cursor")

	// ErrReadActionFailed is returned when a read action or unread action fails
	ErrReadActionFailed = errors.New("read action failed")

	// ErrEmailIsNotDraft is returned when expected draft type is not met
	ErrEmailIsNotDraft = errors.New("email type is not draft")
)

Errors

Functions

This section is empty.

Types

type AlreadyTrashedError

type AlreadyTrashedError struct {
	Type string // 'email' or 'thread'
}

func (*AlreadyTrashedError) Error

func (e *AlreadyTrashedError) Error() string

func (*AlreadyTrashedError) Is

func (e *AlreadyTrashedError) Is(target error) bool

type CreateAndSendEmailAPI

type CreateAndSendEmailAPI interface {
	GetItemAPI
	PutItemAPI
	SendEmailAPI
}

CreateAndSendEmailAPI defines set of API required to create an email and send it

type DeleteEmailAPI

type DeleteEmailAPI interface {
	DeleteItemAPI
	GetItemAPI // to check if it's part of a thread
}

DeleteEmailAPI defines set of API required to delete an email

type DeleteItemAPI

type DeleteItemAPI interface {
	DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
	storage.S3DeleteObjectAPI
}

DeleteItemAPI defines DynamoDB DeleteItem and S3 DeleteObject API

type DeleteThreadAPI

type DeleteThreadAPI interface {
	TransactWriteItemsAPI
	GetItemAPI // to get emails of the thread
	storage.S3DeleteObjectAPI
}

DeleteThreadAPI defines set of API required to delete a thread and its emails

type GetAndSendEmailAPI

type GetAndSendEmailAPI interface {
	GetItemAPI
	SendEmailAPI
}

GetAndSendEmailAPI defines set of API required to get and send a email

type GetEmailAPI

type GetEmailAPI interface {
	GetItemAPI
	UpdateItemAPI
}

type GetItemAPI

type GetItemAPI interface {
	GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
}

GetItemAPI defines set of API required to get an email

type GetItemContentAPI

type GetItemContentAPI interface {
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

GetItemContentAPI defines set of API required to get attachments or inlines of an email

type GetThreadWithEmailsAPI

type GetThreadWithEmailsAPI interface {
	GetItemAPI
	BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
}

GetThreadAPI defines set of API required to get a thread and its emails

type NotTrashedError

type NotTrashedError struct {
	Type string // 'email' or 'thread'
}

NotTrashedError is returned when trying to delete or untrash an untrashed email/thread

func (*NotTrashedError) Error

func (e *NotTrashedError) Error() string

func (*NotTrashedError) Is

func (e *NotTrashedError) Is(target error) bool

type PutItemAPI

type PutItemAPI interface {
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
}

PutItemAPI defines set of API required to create an new email or replaces an existing email

type QueryAPI

type QueryAPI interface {
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
}

QueryAPI defines set of API required to query for emails

type QueryAndGetItemAPI

type QueryAndGetItemAPI interface {
	QueryAPI
	GetItemAPI
}

type ReparseEmailAPI added in v1.8.1

type ReparseEmailAPI interface {
	storage.S3GetObjectAPI
	UpdateItemAPI
}

type SQSSendMessageAPI added in v1.7.2

type SQSSendMessageAPI interface {
	//revive:disable:var-naming
	GetQueueUrl(ctx context.Context, params *sqs.GetQueueUrlInput, optFns ...func(*sqs.Options)) (*sqs.GetQueueUrlOutput, error)
	SendMessage(ctx context.Context, params *sqs.SendMessageInput, optFns ...func(*sqs.Options)) (*sqs.SendMessageOutput, error)
}

SQSSendMessageAPI defines set of API required by SendEmailReceipt and SendEmailNotification functions

type SaveAndSendEmailAPI

type SaveAndSendEmailAPI interface {
	GetItemAPI
	PutItemAPI
	SendEmailAPI
}

SaveAndSendEmailAPI defines set of API required to save an email and send it

type SendEmailAPI

type SendEmailAPI interface {
	TransactWriteItemsAPI
	SendEmail(ctx context.Context, params *sesv2.SendEmailInput, optFns ...func(*sesv2.Options)) (*sesv2.SendEmailOutput, error)
}

SendEmailAPI defines set of API required to send a email

type StoreEmailAPI

type StoreEmailAPI interface {
	QueryAPI
	GetItemAPI
	PutItemAPI
	TransactWriteItemsAPI
}

type TransactWriteItemsAPI

type TransactWriteItemsAPI interface {
	TransactWriteItems(ctx context.Context, params *dynamodb.TransactWriteItemsInput, optFns ...func(*dynamodb.Options)) (*dynamodb.TransactWriteItemsOutput, error)
}

type UpdateItemAPI

type UpdateItemAPI interface {
	UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
}

UpdateItemAPI defines set of API required to update an email

Jump to

Keyboard shortcuts

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