32 lines
757 B
Go
32 lines
757 B
Go
|
|
package imapclient
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"email-mcp/internal/secretstore"
|
||
|
|
)
|
||
|
|
|
||
|
|
type Mailbox struct {
|
||
|
|
Name string `json:"name"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type MessageSummary struct {
|
||
|
|
ID string `json:"id"`
|
||
|
|
Subject string `json:"subject"`
|
||
|
|
From string `json:"from"`
|
||
|
|
UID uint32 `json:"uid"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type Message struct {
|
||
|
|
ID string `json:"id"`
|
||
|
|
Mailbox string `json:"mailbox"`
|
||
|
|
Headers map[string]string `json:"headers"`
|
||
|
|
Body string `json:"body"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type Backend interface {
|
||
|
|
ListMailboxes(context.Context, secretstore.Credential) ([]Mailbox, error)
|
||
|
|
ListMessages(context.Context, secretstore.Credential, string, int) ([]MessageSummary, error)
|
||
|
|
GetMessage(context.Context, secretstore.Credential, string, string) (Message, error)
|
||
|
|
}
|