email_storage

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// queue group
	QUEUE_GROUP = "email-storage-service"

	// consumer config
	CONSUMER_NAME         = "email-storage-consumer"
	ACK_WAIT              = 30 * time.Second
	MAX_DELIVERY_ATTEMPTS = 5
	MAX_ACK_PENDING       = 100
	FETCH_BATCH_SIZE      = 50
	MAX_FETCH_WAIT        = 500 * time.Millisecond
	ERR_BACKOFF           = 100 * time.Millisecond
)

Variables

View Source
var SUBSCRIBED_SUBJECT = enum.EventEmailInboundReceivedIMAP.String()

Functions

func NewEmailStorageService

func NewEmailStorageService(
	natsConn *nats_internal.NATSConnections,
	repositories *repository.Repositories,
	imapService interfaces.IMAPService,
	emlStorage interfaces.StorageService,
) interfaces.EmailProcessor

Types

type EmailStorageService

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

func (*EmailStorageService) Close

func (s *EmailStorageService) Close() error

Close gracefully shuts down the service

func (*EmailStorageService) NewEmailLog

func (s *EmailStorageService) NewEmailLog() *models.EmailLog

func (*EmailStorageService) SaveIMAPMessageAsEML

func (s *EmailStorageService) SaveIMAPMessageAsEML(ctx context.Context, msg *imap.Message, emailID string) (string, error)

func (*EmailStorageService) Start

func (s *EmailStorageService) Start(ctx context.Context) error

Start begins listening for raw email events and processing them

Jump to

Keyboard shortcuts

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