mail

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MailRPCEndpoint = "/mail/rpc"
)

Variables

View Source
var (
	ErrMessageIDRequired   = errors.New("message id is required")
	ErrRecipientRequired   = errors.New("mail recipient is required")
	ErrSubjectRequired     = errors.New("mail subject is required")
	ErrBodyRequired        = errors.New("mail body is required")
	ErrAttachmentIndexZero = errors.New("attachment index must be >= 0")
)

Functions

This section is empty.

Types

type AccountRequest

type AccountRequest struct {
	IdentityName string
}

type AttachmentRequest

type AttachmentRequest struct {
	IdentityName    string
	MessageID       string
	AttachmentIndex int
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(resolved *appconfig.Resolved) (*Client, error)

func (*Client) AuthenticatedRPCCall

func (c *Client) AuthenticatedRPCCall(ctx context.Context, endpoint string, method string, params any, auth *authsdk.Session, out any) error

func (*Client) AuthenticatedRPCCallProfile

func (c *Client) AuthenticatedRPCCallProfile(ctx context.Context, profile transportcfg.Profile, endpoint string, method string, params any, auth *authsdk.Session, out any) error

type CommandResult

type CommandResult struct {
	Data     map[string]any
	Summary  string
	Warnings []string
}

type InboxRequest

type InboxRequest struct {
	IdentityName string
	Folder       string
	Limit        int
	Offset       int
	UnreadOnly   bool
}

type MarkReadRequest

type MarkReadRequest struct {
	IdentityName string
	MessageIDs   []string
	IsRead       bool
}

type ReadRequest

type ReadRequest struct {
	IdentityName string
	MessageID    string
}

type SendRequest

type SendRequest struct {
	IdentityName string
	To           []string
	CC           []string
	Subject      string
	BodyText     string
	BodyHTML     string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(resolved *appconfig.Resolved) (*Service, error)

func (*Service) Account

func (s *Service) Account(ctx context.Context, request AccountRequest) (*CommandResult, error)

func (*Service) Attachment

func (s *Service) Attachment(ctx context.Context, request AttachmentRequest) (*CommandResult, error)

func (*Service) Config

func (s *Service) Config() *appconfig.Resolved

func (*Service) Inbox

func (s *Service) Inbox(ctx context.Context, request InboxRequest) (*CommandResult, error)

func (*Service) MarkRead

func (s *Service) MarkRead(ctx context.Context, request MarkReadRequest) (*CommandResult, error)

func (*Service) Notifications

func (s *Service) Notifications(ctx context.Context, identityName string, limit int) (*CommandResult, error)

Notifications returns recent local mail-notification records from the local websocket cache.

This does not call the remote mail-service. Instead, it reads from the same sqlite database used by the runtime listener for direct/group messages and surfaces rows recognized as local mail notifications, including both: - legacy rows with content_type = "mail.notification" - current rows with metadata.source_kind = "mail"

func (*Service) Read

func (s *Service) Read(ctx context.Context, request ReadRequest) (*CommandResult, error)

func (*Service) Send

func (s *Service) Send(ctx context.Context, request SendRequest) (*CommandResult, error)

type ServiceError

type ServiceError struct {
	StatusCode int
	RPCCode    int
	Message    string
	Data       any
}

func (*ServiceError) Error

func (e *ServiceError) Error() string

Jump to

Keyboard shortcuts

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