app

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package app imports all providers to trigger their init() registration. Add new provider imports here — this is the ONLY file to modify when adding providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(cfg *Config) error

ValidateConfig validates required configuration.

Types

type Application

type Application struct {
	Config         *Config
	GatewayService *service.GatewayService
	MemoryStore    *memory.Store
	Router         *presentation.Router
}

The Application holds all wired dependencies.

func Wire

func Wire(cfg *Config) (*Application, error)

type ChatConfigMap

type ChatConfigMap map[string]string

type Config

type Config struct {
	Environment string         `yaml:"environment"`
	Server      ServerConfig   `yaml:"server"`
	DevBox      DevBoxConfig   `yaml:"devbox"`
	Providers   ProviderConfig `yaml:"providers"`
	Mailpit     MailpitConfig  `yaml:"mailpit,omitempty"`

	// Parsed provider configs - using registry types as single source of truth
	EmailProviders map[string]registry.EmailConfig `yaml:"-"`
	SMSProviders   map[string]registry.SMSConfig   `yaml:"-"`
	PushProviders  map[string]registry.PushConfig  `yaml:"-"`
	ChatProviders  map[string]registry.ChatConfig  `yaml:"-"`
}

Config represents the application configuration.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads configuration from a YAML file.

func (*Config) DefaultChatProvider

func (c *Config) DefaultChatProvider() string

func (*Config) DefaultEmailProvider

func (c *Config) DefaultEmailProvider() string

func (*Config) DefaultPushProvider

func (c *Config) DefaultPushProvider() string

func (*Config) DefaultSMSProvider

func (c *Config) DefaultSMSProvider() string

type DevBoxConfig

type DevBoxConfig struct {
	Enabled bool `yaml:"enabled"`
	Port    int  `yaml:"port"`
}

DevBoxConfig holds devbox configuration.

type EmailConfigMap

type EmailConfigMap map[string]string

type MailpitConfig

type MailpitConfig struct {
	Enabled bool `yaml:"enabled,omitempty"`
}

MailpitConfig holds SMTP forwarding configuration.

type ProviderConfig

type ProviderConfig struct {
	Defaults ProviderDefaults          `yaml:"defaults"`
	Email    map[string]EmailConfigMap `yaml:"email"`
	SMS      map[string]SMSConfigMap   `yaml:"sms"`
	Push     map[string]PushConfigMap  `yaml:"push"`
	Chat     map[string]ChatConfigMap  `yaml:"chat"`
}

ProviderConfig holds provider configuration.

type ProviderDefaults

type ProviderDefaults struct {
	Email string `yaml:"email"`
	SMS   string `yaml:"sms"`
	Push  string `yaml:"push"`
	Chat  string `yaml:"chat"`
}

ProviderDefaults holds default provider names.

type ProviderFactory

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

ProviderFactory creates provider instances using the registry.

func NewProviderFactory

func NewProviderFactory(cfg *Config) *ProviderFactory

NewProviderFactory creates a new provider factory.

func (*ProviderFactory) CreateChatProvider

func (f *ProviderFactory) CreateChatProvider(name string) (port.ChatSender, error)

CreateChatProvider creates a chat provider by name.

func (*ProviderFactory) CreateEmailProvider

func (f *ProviderFactory) CreateEmailProvider(name string) (port.EmailSender, error)

CreateEmailProvider creates an email provider by name.

func (*ProviderFactory) CreatePushProvider

func (f *ProviderFactory) CreatePushProvider(name string) (port.PushSender, error)

CreatePushProvider creates a push provider by name.

func (*ProviderFactory) CreateSMSProvider

func (f *ProviderFactory) CreateSMSProvider(name string) (port.SMSSender, error)

CreateSMSProvider creates an SMS provider by name.

type PushConfigMap

type PushConfigMap map[string]string

type SMSConfigMap

type SMSConfigMap map[string]string

type ServerConfig

type ServerConfig struct {
	Port int `yaml:"port"`
}

ServerConfig holds server configuration.

Directories

Path Synopsis
Package registry provides provider registration functionality.
Package registry provides provider registration functionality.

Jump to

Keyboard shortcuts

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