Versions in this module Expand all Collapse all v1 v1.0.0 Jan 30, 2026 Changes in this version + func CORSMiddleware(next http.Handler) http.Handler + func CacheMiddleware(next http.Handler) http.Handler + func CompressionMiddleware(next http.Handler) http.Handler + func GetTrackingPixelURL(emailID string) string + func IsFocusModeActive() bool + func IsSenderAllowed(email string) (bool, string) + func MethodOverrideMiddleware(next http.Handler) http.Handler + func NewAirCmd() *cobra.Command + func ParseBool(query url.Values, key string) bool + func ParseInt(query url.Values, key string, defaultVal, minVal, maxVal int) int + func ParseInt64(query url.Values, key string, defaultVal int64) int64 + func ParseLimit(query url.Values, defaultVal int) int + func PerformanceMonitoringMiddleware(next http.Handler) http.Handler + func RecordAIUsage(task string, tokens int, cost float64) + func RecordEmailReceived() + func RecordEmailSent() + func RecordInboxZero() + func RegisterEmailForTracking(emailID, recipient string) + func SecurityHeadersMiddleware(next http.Handler) http.Handler + func ShouldAllowNotification(senderEmail string) bool + type AIConfig struct + APIKey string + BaseURL string + Enabled bool + MaxTokens int + Model string + Provider string + TaskModels map[string]string + Temperature float64 + UsageBudget float64 + UsageSpent float64 + type AIRequest struct + EmailID string + Prompt string + type AIResponse struct + Error string + Success bool + Summary string + type AIUsageStats struct + RequestsByTask map[string]int + TokensByTask map[string]int + TotalCost float64 + TotalRequests int + TotalTokens int + type Attachment struct + Icon string + Name string + Size string + type AttachmentResponse struct + ContentType string + Filename string + ID string + Size int64 + type Attendee struct + Avatar string + Color string + Name string + type AutoLabelRequest struct + Body string + EmailID string + From string + Subject string + type AutoLabelResponse struct + Category string + Error string + Labels []string + Priority string + Success bool + type AvailabilityRequest struct + DurationMinutes int + EndTime int64 + IntervalMinutes int + Participants []string + StartTime int64 + type AvailabilityResponse struct + Message string + Slots []AvailableSlotResponse + type AvailableSlotResponse struct + Emails []string + EndTime int64 + StartTime int64 + type Bundle struct + Collapsed bool + Count int + Description string + ID string + Icon string + LastUpdated time.Time + Name string + Rules []BundleRule + UnreadCount int + type BundleRule struct + Field string + Operator string + Priority int + Value string + type BundleStore struct + func NewBundleStore() *BundleStore + type BundledEmail struct + BundleID string + EmailID string + Score int + type CacheAccountInfo struct + ContactCount int + Email string + EmailCount int + EventCount int + LastSync *time.Time + SizeBytes int64 + type CacheSearchResponse struct + Query string + Results []CacheSearchResult + Total int + type CacheSearchResult struct + Date int64 + ID string + Subtitle string + Title string + Type string + type CacheSettingsResponse struct + CompactMode bool + DefaultView string + Enabled bool + EncryptionEnabled bool + MaxSizeMB int + OfflineQueueEnabled bool + PreviewPosition string + SyncIntervalMinutes int + TTLDays int + Theme string + type CacheStatusResponse struct + Accounts []CacheAccountInfo + Enabled bool + EncryptionEnabled bool + LastSync *time.Time + Online bool + PendingActions int + SyncInterval int + TotalSizeBytes int64 + type CacheSyncResponse struct + Error string + Message string + Success bool + type Calendar struct + Color string + ID string + IsPrimary bool + Name string + type CalendarResponse struct + Description string + HexColor string + ID string + IsPrimary bool + Name string + ReadOnly bool + Timezone string + type CalendarsResponse struct + Calendars []CalendarResponse + type CategorizedEmail struct + CategorizedAt int64 + Category InboxCategory + EmailID string + MatchedRule string + type CategoryRule struct + Category InboxCategory + CreatedAt int64 + Description string + ID string + IsRegex bool + Pattern string + Priority int + Type string + type CompleteRequest struct + Context string + MaxLength int + Text string + type CompleteResponse struct + Confidence float64 + Suggestion string + type ConferencingResponse struct + Provider string + URL string + type ConfigStatusResponse struct + ClientID string + Configured bool + DefaultGrant string + GrantCount int + HasAPIKey bool + Region string + type ConflictsResponse struct + Conflicts []EventConflict + HasMore bool + type Contact struct + Avatar string + AvatarColor string + Company string + Email string + ID string + IsVIP bool + Letter string + Name string + Role string + type ContactActionResponse struct + Contact *ContactResponse + Error string + Message string + Success bool + type ContactAddressResponse struct + City string + Country string + PostalCode string + State string + StreetAddress string + Type string + type ContactEmailResponse struct + Email string + Type string + type ContactGroupResponse struct + ID string + Name string + Path string + type ContactGroupsResponse struct + Groups []ContactGroupResponse + type ContactPhoneResponse struct + Number string + Type string + type ContactResponse struct + Addresses []ContactAddressResponse + Birthday string + CompanyName string + DisplayName string + Emails []ContactEmailResponse + GivenName string + ID string + JobTitle string + Nickname string + Notes string + PhoneNumbers []ContactPhoneResponse + PictureURL string + Source string + Surname string + type ContactsResponse struct + Contacts []ContactResponse + HasMore bool + NextCursor string + type CreateContactRequest struct + Addresses []ContactAddressResponse + Birthday string + CompanyName string + Emails []ContactEmailResponse + GivenName string + JobTitle string + Nickname string + Notes string + PhoneNumbers []ContactPhoneResponse + Surname string + type CreateEventRequest struct + Busy bool + CalendarID string + Description string + EndTime int64 + IsAllDay bool + Location string + Participants []EventParticipantResponse + StartTime int64 + Timezone string + Title string + type CreateNotetakerRequest struct + BotName string + JoinTime int64 + MeetingLink string + type DayVolume struct + Date string + Received int + Sent int + type DraftRequest struct + Bcc []EmailParticipantResponse + Body string + Cc []EmailParticipantResponse + ReplyToMsgID string + Subject string + To []EmailParticipantResponse + type DraftResponse struct + Bcc []EmailParticipantResponse + Body string + Cc []EmailParticipantResponse + Date int64 + ID string + Subject string + To []EmailParticipantResponse + type DraftsResponse struct + Drafts []DraftResponse + type Email struct + AttachmentCount int + Attachments []Attachment + Body string + From string + FromAvatar string + FromEmail string + HasAISummary bool + HasAttachment bool + ID string + IsSelected bool + IsStarred bool + IsUnread bool + Preview string + Priority string + Subject string + Time string + type EmailAnalytics struct + AvgResponseTime float64 + BestStreak int + BusiestDay string + BusiestHour int + CurrentStreak int + DailyVolume map[string]int + FocusTimeHours float64 + HourlyVolume map[int]int + InboxZeroCount int + PeriodEnd time.Time + PeriodStart time.Time + ResponseRate float64 + TopRecipients []SenderStats + TopSenders []SenderStats + TotalArchived int + TotalDeleted int + TotalReceived int + TotalSent int + WeeklyTrend []DayVolume + type EmailParticipantResponse struct + Email string + Name string + type EmailResponse struct + Attachments []AttachmentResponse + Body string + Cc []EmailParticipantResponse + Date int64 + Folders []string + From []EmailParticipantResponse + ID string + Snippet string + Starred bool + Subject string + ThreadID string + To []EmailParticipantResponse + Unread bool + type EmailTemplate struct + Body string + Category string + CreatedAt int64 + ID string + Metadata map[string]string + Name string + Shortcut string + Subject string + UpdatedAt int64 + UsageCount int + Variables []string + type EmailsResponse struct + Emails []EmailResponse + HasMore bool + NextCursor string + type EnhancedSummaryRequest struct + Body string + EmailID string + From string + Subject string + type EnhancedSummaryResponse struct + ActionItems []string + Category string + Error string + Sentiment string + Success bool + Summary string + type Event struct + Attendees []Attendee + Description string + EndTime string + ID string + IsAISuggestion bool + IsFocusTime bool + Location string + StartTime string + Tags []string + Title string + type EventActionResponse struct + Error string + Event *EventResponse + Message string + Success bool + type EventConflict struct + Event1 EventResponse + Event2 EventResponse + type EventParticipantResponse struct + Email string + Name string + Status string + type EventResponse struct + Busy bool + CalendarID string + Conferencing *ConferencingResponse + Description string + EndTime int64 + HtmlLink string + ID string + IsAllDay bool + Location string + Participants []EventParticipantResponse + StartTime int64 + Status string + Timezone string + Title string + type EventsResponse struct + Events []EventResponse + HasMore bool + NextCursor string + type FocusModeSettings struct + AllowedSenders []string + AutoReplyEnabled bool + AutoReplyMessage string + DefaultDuration int + HideEmailList bool + HideNotifications bool + MuteSound bool + PomodoroBreak int + PomodoroLongBreak int + PomodoroWork int + SessionsBeforeLong int + type FocusModeState struct + BreakDuration int + Duration int + EndsAt time.Time + InBreak bool + IsActive bool + PomodoroMode bool + SessionCount int + StartedAt time.Time + type FocusTimeSuggestion struct + Day string + EndHour int + Reason string + Score int + StartHour int + type Folder struct + Count int + ID string + Icon string + IsActive bool + Name string + UnreadCount int + type FolderResponse struct + ID string + Name string + SystemFolder string + TotalCount int + UnreadCount int + type FoldersResponse struct + Folders []FolderResponse + type FreeBusyCalendarResponse struct + Email string + TimeSlots []TimeSlotResponse + type FreeBusyRequest struct + Emails []string + EndTime int64 + StartTime int64 + type FreeBusyResponse struct + Data []FreeBusyCalendarResponse + type Grant struct + Email string + ID string + Provider string + type GrantInfo struct + Email string + ID string + IsDefault bool + Provider string + type GrantsResponse struct + DefaultGrant string + Grants []Grant + type InboxCategory string + const CategoryForums + const CategoryNewsletters + const CategoryPrimary + const CategoryPromotions + const CategorySocial + const CategoryUpdates + const CategoryVIP + type Label struct + Color string + Name string + type MediaResponse struct + ExpiresAt int64 + RecordingSize int64 + RecordingURL string + TranscriptSize int64 + TranscriptURL string + type NLSearchRequest struct + Query string + type NLSearchResponse struct + DateAfter string + DateBefore string + From string + HasAttach bool + IsUnread bool + Keywords string + Subject string + To string + type NotetakerResponse struct + Attendees string + CreatedAt string + ExternalURL string + HasRecording bool + HasTranscript bool + ID string + IsExternal bool + JoinTime string + MeetingLink string + MeetingTitle string + Provider string + State string + Summary string + type NotetakerSource struct + From string + LinkDomain string + Subject string + type PageData struct + AccountsCount int + ActiveFolder string + ActiveView string + Calendars []Calendar + ClientID string + Configured bool + Contacts []Contact + DefaultGrantID string + Emails []Email + Events []Event + Folders []Folder + Grants []GrantInfo + HasAPIKey bool + Provider string + Region string + SelectedEmail *Email + SyncedAt time.Time + UnreadCount int + UserAvatar string + UserEmail string + UserName string + type PendingSend struct + Bcc []EmailParticipantResponse + Body string + Cancelled bool + Cc []EmailParticipantResponse + CreatedAt int64 + ID string + SendAt int64 + Subject string + To []EmailParticipantResponse + type QueryParams struct + func NewQueryParams(values url.Values) *QueryParams + func (q *QueryParams) Get(key string) string + func (q *QueryParams) GetBool(key string) bool + func (q *QueryParams) GetBoolPtr(key string) *bool + func (q *QueryParams) GetInt(key string, defaultVal, minVal, maxVal int) int + func (q *QueryParams) GetInt64(key string, defaultVal int64) int64 + func (q *QueryParams) GetLimit(defaultVal int) int + func (q *QueryParams) GetString(key, defaultVal string) string + func (q *QueryParams) Has(key string) bool + type ReadReceipt struct + Device string + EmailID string + IsOpened bool + Location string + OpenCount int + OpenedAt time.Time + Recipient string + UserAgent string + type ReadReceiptSettings struct + BlockTracking bool + Enabled bool + ShowNotification bool + TrackClicks bool + TrackOpens bool + type ReplyLaterItem struct + AddedAt time.Time + DraftID string + EmailID string + From string + IsCompleted bool + Notes string + Priority int + RemindAt time.Time + Subject string + func GetPendingReminders() []*ReplyLaterItem + type ScheduledSendRequest struct + Bcc []EmailParticipantResponse + Body string + Cc []EmailParticipantResponse + SendAt int64 + SendAtNatural string + Subject string + To []EmailParticipantResponse + type ScheduledSendResponse struct + Error string + Message string + ScheduleID string + SendAt int64 + Success bool + type ScreenedSender struct + Destination string + Domain string + Email string + EmailCount int + FirstSeen time.Time + Name string + SampleSubj string + Status string + type ScreenerStore struct + type SendMessageRequest struct + Bcc []EmailParticipantResponse + Body string + Cc []EmailParticipantResponse + ReplyToMsgID string + Subject string + To []EmailParticipantResponse + type SendMessageResponse struct + Error string + Message string + MessageID string + Success bool + type SenderStats struct + AvgReply float64 + Count int + Email string + Name string + type Server struct + func NewDemoServer(addr string) *Server + func NewServer(addr string) *Server + func (s *Server) IsOnline() bool + func (s *Server) SetOnline(online bool) + func (s *Server) Start() error + func (s *Server) Stop() error + type SetDefaultGrantRequest struct + GrantID string + type SetDefaultGrantResponse struct + Error string + Message string + Success bool + type SmartReplyRequest struct + Body string + EmailID string + From string + ReplyType string + Subject string + type SmartReplyResponse struct + Error string + Replies []string + Success bool + type SnoozeRequest struct + Duration string + EmailID string + SnoozeUntil int64 + type SnoozeResponse struct + EmailID string + Message string + SnoozeUntil int64 + Success bool + type SnoozedEmail struct + CreatedAt int64 + EmailID string + OriginalFolder string + SnoozeUntil int64 + type SplitInboxConfig struct + Categories []InboxCategory + Enabled bool + Rules []CategoryRule + VIPSenders []string + type SplitInboxResponse struct + Categories map[InboxCategory]int + Config SplitInboxConfig + Recent map[InboxCategory][]EmailResponse + type TemplateListResponse struct + Templates []EmailTemplate + Total int + type ThreadMessage struct + Body string + Date int64 + From string + Subject string + type ThreadSummaryRequest struct + Messages []ThreadMessage + ThreadID string + type ThreadSummaryResponse struct + ActionItems []string + Error string + KeyPoints []string + MessageCount int + NextSteps string + Participants []string + Success bool + Summary string + Timeline string + type TimeSlotResponse struct + EndTime int64 + StartTime int64 + Status string + type UndoSendConfig struct + Enabled bool + GracePeriodSec int + type UndoSendResponse struct + Error string + Message string + MessageID string + Success bool + TimeLeft int + type UpdateContactRequest struct + Addresses []ContactAddressResponse + Birthday *string + CompanyName *string + Emails []ContactEmailResponse + GivenName *string + JobTitle *string + Nickname *string + Notes *string + PhoneNumbers []ContactPhoneResponse + Surname *string + type UpdateEmailRequest struct + Folders []string + Starred *bool + Unread *bool + type UpdateEmailResponse struct + Error string + Message string + Success bool + type UpdateEventRequest struct + Busy *bool + Description *string + EndTime *int64 + IsAllDay *bool + Location *string + Participants []EventParticipantResponse + StartTime *int64 + Timezone *string + Title *string