contracts

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Filename    string `json:"filename"`
	ContentType string `json:"content_type"`
	Data        []byte `json:"data,omitempty"`
	URL         string `json:"url,omitempty"`
}

Attachment represents a file attachment for messages.

type ChatButton

type ChatButton struct {
	ID    string `json:"id"`
	Text  string `json:"text"`
	URL   string `json:"url,omitempty"`
	Phone string `json:"phone,omitempty"`
}

ChatButton represents an interactive button in a chat message.

type ChatMessage

type ChatMessage struct {
	From           string            `json:"from,omitempty"`
	To             []string          `json:"to"`
	Message        string            `json:"message"`
	Platform       string            `json:"platform,omitempty"`
	TemplateID     string            `json:"template_id,omitempty"`
	TemplateParams []string          `json:"template_params,omitempty"`
	MediaURL       string            `json:"media_url,omitempty"`
	MediaType      string            `json:"media_type,omitempty"`
	Buttons        []ChatButton      `json:"buttons,omitempty"`
	ReplyToID      string            `json:"reply_to_id,omitempty"`
	Metadata       map[string]string `json:"metadata,omitempty"`
}

ChatMessage represents a message to be sent via chat/social platforms.

type ChatSender

type ChatSender interface {
	Send(ctx context.Context, message *ChatMessage) (*SendResult, error)
	Name() string
}

ChatSender defines the contract for sending chat/social media messages.

type Email

type Email struct {
	From        string            `json:"from,omitempty"`
	FromName    string            `json:"from_name,omitempty"`
	To          []string          `json:"to"`
	CC          []string          `json:"cc,omitempty"`
	BCC         []string          `json:"bcc,omitempty"`
	ReplyTo     string            `json:"reply_to,omitempty"`
	Subject     string            `json:"subject"`
	HTML        string            `json:"html,omitempty"`
	PlainText   string            `json:"plain_text,omitempty"`
	Attachments []Attachment      `json:"attachments,omitempty"`
	Headers     map[string]string `json:"headers,omitempty"`
}

Email represents an email message to be sent.

type EmailSender

type EmailSender interface {
	Send(ctx context.Context, email *Email) (*SendResult, error)
	Name() string
}

EmailSender defines the contract for sending emails.

type PushNotification

type PushNotification struct {
	DeviceTokens []string          `json:"device_tokens"`
	Title        string            `json:"title"`
	Body         string            `json:"body"`
	Data         map[string]string `json:"data,omitempty"`
	Badge        *int              `json:"badge,omitempty"`
	Sound        string            `json:"sound,omitempty"`
}

PushNotification represents a push notification to be sent.

type PushSender

type PushSender interface {
	Send(ctx context.Context, notification *PushNotification) (*SendResult, error)
	Name() string
}

PushSender defines the contract for sending push notifications.

type SMS

type SMS struct {
	From    string   `json:"from,omitempty"`
	To      []string `json:"to"`
	Message string   `json:"message"`
}

SMS represents an SMS message to be sent.

type SMSSender

type SMSSender interface {
	Send(ctx context.Context, sms *SMS) (*SendResult, error)
	Name() string
}

SMSSender defines the contract for sending SMS messages.

type SendResult

type SendResult struct {
	ID         string            `json:"id"`
	StatusCode int               `json:"status_code"`
	Message    string            `json:"message"`
	Meta       map[string]string `json:"meta,omitempty"`
}

SendResult represents the result of sending a message.

Jump to

Keyboard shortcuts

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