interfaces

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailAttachmentRepository

type EmailAttachmentRepository interface {
	Create(ctx context.Context, attachment *models.EmailAttachment) error
	GetByID(ctx context.Context, id string) (*models.EmailAttachment, error)
	ListByEmail(ctx context.Context, emailID string) ([]*models.EmailAttachment, error)
	Store(ctx context.Context, attachment *models.EmailAttachment, data []byte) error
	GetAttachment(ctx context.Context, id string) ([]byte, error)
	Delete(ctx context.Context, id string) error
}

type EmailFilterService

type EmailFilterService interface {
	ScanEmail(ctx context.Context, email *models.Email) error
}

type EmailRepository

type EmailRepository interface {
	Create(ctx context.Context, email *models.Email) 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
}

type EmailService

type EmailService interface {
	Send()
	GetMessage()
}

type FolderStats

type FolderStats struct {
	Total    uint32
	Unseen   uint32
	LastSeen uint32
	LastSync time.Time
}

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
	Status() map[string]MailboxStatus
	SetEventHandler(handler func(ctx context.Context, mailEvent MailEvent))
}

type MailEvent

type MailEvent struct {
	Source    string
	MailboxID string
	Folder    string
	MessageID uint32
	EventType string
	Message   interface{}
}

type MailboxRepository

type MailboxRepository interface {
	GetMailboxes(ctx context.Context) ([]*models.Mailbox, error)
	GetMailbox(ctx context.Context, id string) (*models.Mailbox, error)
	SaveMailbox(ctx context.Context, mailbox models.Mailbox) error
	DeleteMailbox(ctx context.Context, id string) error
}

type MailboxStatus

type MailboxStatus struct {
	Connected   bool
	LastError   string
	Folders     map[string]FolderStats
	LastChecked time.Time
}

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 StorageService

type StorageService interface {
	Upload(ctx context.Context, key string, data []byte, contentType string) error
	Download(ctx context.Context, key string) ([]byte, error)
	Delete(ctx context.Context, key string) error
	GetPublicURL(key string) string
}

Jump to

Keyboard shortcuts

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