Versions in this module Expand all Collapse all v0 v0.7.0 Feb 9, 2026 Changes in this version + func CORSMiddleware(cfg CORSConfig) func(http.Handler) http.Handler + func RateLimitMiddleware(limiter *RateLimiter) func(http.Handler) http.Handler + type APIAttachment = store.APIAttachment + type APIMessage = store.APIMessage + type AccountInfo struct + DisplayName string + Email string + Enabled bool + LastSyncAt string + NextSyncAt string + Schedule string + type AccountStatus = scheduler.AccountStatus + type AttachmentInfo struct + Filename string + MimeType string + Size int64 + type CORSConfig struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + MaxAge int + func DefaultCORSConfig() CORSConfig + type ErrorResponse struct + Error string + Message string + type MessageDetail struct + Attachments []AttachmentInfo + Body string + type MessageStore interface + GetMessage func(id int64) (*APIMessage, error) + GetStats func() (*StoreStats, error) + ListMessages func(offset, limit int) ([]APIMessage, int64, error) + SearchMessages func(query string, offset, limit int) ([]APIMessage, int64, error) + type MessageSummary struct + From string + HasAttach bool + ID int64 + Labels []string + SentAt string + SizeBytes int64 + Snippet string + Subject string + To []string + type RateLimiter struct + func NewRateLimiter(rps float64, burst int) *RateLimiter + func (rl *RateLimiter) Allow(key string) bool + func (rl *RateLimiter) Close() + type SchedulerStatusResponse struct + Accounts []AccountStatus + Running bool + type SearchResult struct + Messages []MessageSummary + Page int + PageSize int + Query string + Total int64 + type Server struct + func NewServer(cfg *config.Config, store MessageStore, sched SyncScheduler, ...) *Server + func (s *Server) Router() chi.Router + func (s *Server) Shutdown(ctx context.Context) error + func (s *Server) Start() error + type StatsResponse struct + DatabaseSize int64 + TotalAccounts int64 + TotalAttach int64 + TotalLabels int64 + TotalMessages int64 + TotalThreads int64 + type StoreStats = store.Stats + type SyncScheduler interface + IsRunning func() bool + IsScheduled func(email string) bool + Status func() []AccountStatus + TriggerSync func(email string) error