Documentation
¶
Index ¶
- type AIService
- type AttachmentFile
- type CloudflareService
- type CreateMailboxRequest
- type DNSRecord
- type DomainService
- type EmailAttachmentRepository
- type EmailProcessor
- type EmailRepository
- type EmailService
- type EmailStore
- type EmailThreadRepository
- type EventListener
- type EventPublisher
- type EventSubscriber
- type FolderStats
- type IMAPProcessor
- type IMAPService
- type MailEvent
- type MailboxDetails
- type MailboxRepository
- type MailboxService
- type MailboxServiceOld
- type MailboxStatus
- type MailboxSyncRepository
- type NamecheapDomainInfo
- type NamecheapService
- type OpenSrsService
- type OrphanEmailRepository
- type SenderRepository
- type StorageService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIService ¶ added in v0.1.1
type AIService interface {
GetStructuredEmailBody(ctx context.Context, request dto.StructuredEmailRequest) (*dto.StructuredEmailResponse, error)
}
type AttachmentFile ¶ added in v0.1.12
type CloudflareService ¶ added in v0.0.3
type CloudflareService interface {
SetupDomainForMailStack(ctx context.Context, tenant, domain, destinationUrl string) ([]string, error)
AddDNSRecord(ctx context.Context, zoneID, recordType, name, content string, ttl int, proxied bool, priority *int) error
GetDNSRecords(ctx context.Context, domain string) (*[]DNSRecord, error)
DeleteDNSRecord(ctx context.Context, zoneID string, recordID string) error
CheckDomainExists(ctx context.Context, domain string) (bool, string, error)
}
type CreateMailboxRequest ¶ added in v0.0.3
type DomainService ¶ added in v0.0.3
type DomainService interface {
ConfigureDomain(ctx context.Context, domain, redirectWebsite string) error
GetDomain(ctx context.Context, domain string) (*models.MailStackDomain, error)
CheckMailstackDomainReputations(ctx context.Context) error
GetTenantForMailstackDomain(ctx context.Context, domain string) (string, error)
}
type EmailAttachmentRepository ¶
type EmailAttachmentRepository interface {
GetByID(ctx context.Context, id string) (*models.EmailAttachment, error)
ListByEmail(ctx context.Context, emailID string) ([]*models.EmailAttachment, error)
ListByThread(ctx context.Context, threadID string) ([]*models.EmailAttachment, error)
Store(ctx context.Context, attachment *models.EmailAttachment, threadID, emailID string, data []byte) error
DownloadAttachment(ctx context.Context, id string) ([]byte, error)
Delete(ctx context.Context, id string) error
}
type EmailProcessor ¶ added in v0.1.12
type EmailProcessor interface {
NewInboundEmail() *models.EmailStore
NewAttachment() *models.EmailAttachment
NewAttachmentFile(attachmentID string, data []byte) *AttachmentFile
ProcessEmail(ctx context.Context, email *models.EmailStore, attachments []*models.EmailAttachment, files []*AttachmentFile) error
EmailFilter(ctx context.Context, email *models.EmailStore, headers map[string]interface{}) error
}
type EmailRepository ¶
type EmailRepository interface {
Create(ctx context.Context, email *models.Email) (string, error)
GetByID(ctx context.Context, id string) (*models.Email, error)
GetByUID(ctx context.Context, mailboxID, folder string, uid uint32) (*models.Email, error)
GetByMessageID(ctx context.Context, messageID string) (*models.Email, error)
ListByMailbox(ctx context.Context, mailboxID string, limit, offset int) ([]*models.Email, int64, error)
ListByFolder(ctx context.Context, mailboxID, folder string, limit, offset int) ([]*models.Email, int64, error)
ListByThread(ctx context.Context, threadID string) ([]*models.Email, error)
Search(ctx context.Context, query string, limit, offset int) ([]*models.Email, int64, error)
Update(ctx context.Context, email *models.Email) error
SetEmailRawData(ctx context.Context, emailID string, headers, envelope, bodyStructure models.JSONMap) error
}
type EmailService ¶
type EmailService interface {
ScheduleSend(ctx context.Context, email *models.EmailStore, attachmentIDs []string) (string, enum.EmailStatus, error)
// used only by events
SendWithSMTP(ctx context.Context, mailbox *models.Mailbox, email *models.EmailStore, attachments []*models.EmailAttachment) error
}
type EmailStore ¶ added in v0.1.13
type EmailThreadRepository ¶ added in v0.0.3
type EmailThreadRepository interface {
Create(ctx context.Context, thread *models.EmailThread) (string, error)
GetByID(ctx context.Context, id string) (*models.EmailThread, error)
GetByMailboxIDs(ctx context.Context, mailboxIDs []string, limit int, offset int) ([]*models.EmailThread, error)
CountByMailboxIDs(ctx context.Context, mailboxIDs []string) (int64, error)
Update(ctx context.Context, thread *models.EmailThread) error
GetParticipantsForThread(ctx context.Context, threadID string) ([]string, error)
FindBySubjectAndMailbox(ctx context.Context, subject string, mailboxID string) ([]*models.EmailThread, error)
MarkThreadAsViewed(ctx context.Context, threadID string) error
MarkThreadAsDone(ctx context.Context, threadID string, isDone bool) error
}
type EventListener ¶ added in v0.1.6
type EventPublisher ¶ added in v0.1.6
type EventPublisher interface {
PublishFanoutEvent(ctx context.Context, entityId string, entityType enum.EntityType, message interface{}) error
PublishDirectEvent(ctx context.Context, entityId string, entityType enum.EntityType, message interface{}) error
PublishNotification(ctx context.Context, tenant string, entityId string, entityType enum.EntityType, details *utils.EventCompletedDetails)
PublishNotificationBulk(ctx context.Context, tenant string, entityIds []string, entityType enum.EntityType, details *utils.EventCompletedDetails)
Close() error
}
type EventSubscriber ¶ added in v0.1.6
type FolderStats ¶
type IMAPProcessor ¶ added in v0.1.12
type IMAPProcessor interface {
EmailProcessor
ProcessIMAPMessage(ctx context.Context, inboundEmail dto.EmailReceived) error
}
type IMAPService ¶
type IMAPService interface {
Start(ctx context.Context) error
Stop() error
AddMailbox(ctx context.Context, mailbox *models.Mailbox) error
RemoveMailbox(ctx context.Context, mailboxID string) error
GetMessageByUID(ctx context.Context, mailboxID, folderName string, uid uint32) (*imap.Message, error)
Status() map[string]MailboxStatus
}
type MailboxDetails ¶ added in v0.0.3
type MailboxRepository ¶
type MailboxRepository interface {
GetMailboxes(ctx context.Context) ([]*models.Mailbox, error)
GetMailboxesByUserID(ctx context.Context, userID string) ([]*models.Mailbox, error)
GetMailbox(ctx context.Context, id string) (*models.Mailbox, error)
GetMailboxByEmailAddress(ctx context.Context, emailAddress string) (*models.Mailbox, error)
GetMailboxByEmailAddressCrossTenant(ctx context.Context, emailAddress string) (*models.Mailbox, error)
GetForConfiguration(ctx context.Context, limit int) ([]*models.Mailbox, error)
GetAllWithFilters(ctx context.Context, provider enum.EmailProvider, domain, userId string) ([]*models.Mailbox, error)
SaveMailbox(ctx context.Context, mailbox models.Mailbox) (string, error)
DeleteMailbox(ctx context.Context, id string) error
UpdateConnectionStatus(ctx context.Context, mailboxID string, status enum.ConnectionStatus, errorMessage string) error
UpdateProvisionStatus(ctx context.Context, id string, status models.MailboxProvisionStatus) error
ConfigureAttempt(ctx context.Context, id string) error
GetForRampUp(ctx context.Context) ([]*models.Mailbox, error)
UpdateRampUpFields(ctx context.Context, mailbox *models.Mailbox) error
}
type MailboxService ¶ added in v0.0.3
type MailboxService interface {
EnrollMailbox(ctx context.Context, mailbox *models.Mailbox) (*models.Mailbox, error)
CreateMailbox(ctx context.Context, request CreateMailboxRequest) error
ConfigureMailbox(ctx context.Context, mailboxId string) error
RampUpMailboxes(ctx context.Context) error
GetMailboxes(ctx context.Context, provider enum.EmailProvider, domain, userId string) ([]*models.Mailbox, error)
GetMailboxByEmailAddress(ctx context.Context, emailAddress string) (*models.Mailbox, error)
}
type MailboxServiceOld ¶ added in v0.1.3
type MailboxStatus ¶
type MailboxSyncRepository ¶
type MailboxSyncRepository interface {
GetSyncState(ctx context.Context, mailboxID, folderName string) (*models.MailboxSyncState, error)
SaveSyncState(ctx context.Context, state *models.MailboxSyncState) error
DeleteSyncState(ctx context.Context, mailboxID, folderName string) error
DeleteMailboxSyncStates(ctx context.Context, mailboxID string) error
GetAllSyncStates(ctx context.Context) (map[string]map[string]uint32, error)
GetMailboxSyncStates(ctx context.Context, mailboxID string) (map[string]uint32, error)
}
type NamecheapDomainInfo ¶ added in v0.0.3
type NamecheapService ¶ added in v0.0.3
type NamecheapService interface {
CheckDomainAvailability(ctx context.Context, domain string) (bool, bool, error)
PurchaseDomain(ctx context.Context, tenant, domain string) error
GetDomainPrice(ctx context.Context, domain string) (float64, error)
GetDomainInfo(ctx context.Context, tenant, domain string) (NamecheapDomainInfo, error)
UpdateNameservers(ctx context.Context, tenant, domain string, nameservers []string) error
}
type OpenSrsService ¶ added in v0.0.3
type OpenSrsService interface {
SendEmail(ctx context.Context, request *models.EmailMessage) error
SetupDomain(ctx context.Context, tenant, domain string) error
SetupMailbox(ctx context.Context, tenant, username, password string, forwardingTo []string, webmailEnabled bool) error
GetMailboxDetails(ctx context.Context, email string) (MailboxDetails, error)
}
type OrphanEmailRepository ¶ added in v0.0.3
type OrphanEmailRepository interface {
Create(ctx context.Context, orphan *models.OrphanEmail) (string, error)
GetByID(ctx context.Context, id string) (*models.OrphanEmail, error)
GetByMessageID(ctx context.Context, messageID string) (*models.OrphanEmail, error)
Delete(ctx context.Context, id string) error
DeleteByThreadID(ctx context.Context, threadID string) error
ListByThreadID(ctx context.Context, threadID string) ([]*models.OrphanEmail, error)
ListByMailboxID(ctx context.Context, mailboxID string, limit, offset int) ([]*models.OrphanEmail, error)
DeleteOlderThan(ctx context.Context, cutoffDate time.Time) error
}
type SenderRepository ¶ added in v0.0.22
type SenderRepository interface {
Create(ctx context.Context, sender *models.Sender) error
GetByID(ctx context.Context, id string) (*models.Sender, error)
GetByUserID(ctx context.Context, userID string) ([]models.Sender, error)
GetDefaultForUser(ctx context.Context, userID string) (*models.Sender, error)
Update(ctx context.Context, sender *models.Sender) error
SetDefault(ctx context.Context, id string, userID string) error
SetActive(ctx context.Context, id string, isActive bool) error
Delete(ctx context.Context, id string) error
ListByTenant(ctx context.Context, tenant string, limit, offset int) ([]models.Sender, int64, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.