registry

package
v1.1.7 Latest Latest
Warning

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

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

Documentation

Overview

Package registry provides provider registration functionality. This is a subpackage of app to avoid circular imports when providers register themselves via init().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsChatProviderRegistered

func IsChatProviderRegistered(name string) bool

IsChatProviderRegistered checks if a chat provider is registered.

func IsEmailProviderRegistered

func IsEmailProviderRegistered(name string) bool

IsEmailProviderRegistered checks if an email provider is registered.

func IsPushProviderRegistered

func IsPushProviderRegistered(name string) bool

IsPushProviderRegistered checks if a push provider is registered.

func IsSMSProviderRegistered

func IsSMSProviderRegistered(name string) bool

IsSMSProviderRegistered checks if an SMS provider is registered.

func RegisterChatProvider

func RegisterChatProvider(name string, factory ChatProviderFactory)

RegisterChatProvider registers a chat provider factory.

func RegisterEmailProvider

func RegisterEmailProvider(name string, factory EmailProviderFactory)

RegisterEmailProvider registers an email provider factory. Call this in your provider's init() function.

func RegisterPushProvider

func RegisterPushProvider(name string, factory PushProviderFactory)

RegisterPushProvider registers a push provider factory.

func RegisterSMSProvider

func RegisterSMSProvider(name string, factory SMSProviderFactory)

RegisterSMSProvider registers an SMS provider factory.

Types

type ChatConfig

type ChatConfig struct {
	CommonConfig
	FromPhone  string
	WebhookURL string
}

ChatConfig holds chat provider configuration.

type ChatProviderFactory

type ChatProviderFactory func(cfg ChatConfig) (port.ChatSender, error)

ChatProviderFactory creates a chat provider from config.

func GetChatFactory

func GetChatFactory(name string) (ChatProviderFactory, error)

GetChatFactory returns a chat provider factory by name.

type CommonConfig

type CommonConfig struct {
	APIKey    string
	APISecret string
	Region    string
	BaseURL   string
	Extra     map[string]string
}

CommonConfig shared fields across all providers.

type EmailConfig

type EmailConfig struct {
	CommonConfig
	Domain    string
	FromEmail string
	FromName  string
}

EmailConfig holds email provider configuration.

type EmailProviderFactory

type EmailProviderFactory func(cfg EmailConfig, mailpit MailpitConfig) (port.EmailSender, error)

EmailProviderFactory creates an email provider from config.

func GetEmailFactory

func GetEmailFactory(name string) (EmailProviderFactory, error)

GetEmailFactory returns an email provider factory by name.

type MailpitConfig

type MailpitConfig struct {
	Enabled bool
}

MailpitConfig holds SMTP forwarding configuration.

type PushConfig

type PushConfig struct {
	CommonConfig
	AppID string
	Topic string
}

PushConfig holds push notification provider configuration.

type PushProviderFactory

type PushProviderFactory func(cfg PushConfig) (port.PushSender, error)

PushProviderFactory creates a push provider from config.

func GetPushFactory

func GetPushFactory(name string) (PushProviderFactory, error)

GetPushFactory returns a push provider factory by name.

type SMSConfig

type SMSConfig struct {
	CommonConfig
	FromPhone string
}

SMSConfig holds SMS provider configuration.

type SMSProviderFactory

type SMSProviderFactory func(cfg SMSConfig) (port.SMSSender, error)

SMSProviderFactory creates an SMS provider from config.

func GetSMSFactory

func GetSMSFactory(name string) (SMSProviderFactory, error)

GetSMSFactory returns an SMS provider factory by name.

Jump to

Keyboard shortcuts

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