config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterConfig

type AdapterConfig struct {
	Notify NotifyChannel `mapstructure:"notify"`
	Email  EmailProvider `mapstructure:"email"`
	SMS    SMSProvider   `mapstructure:"sms"`
}

AdapterConfig holds configuration for different notification adapters.

type AppConfig

type AppConfig struct {
	Name string `mapstructure:"name"`
}

AppConfig stores application-specific configuration.

type BrevoConfig

type BrevoConfig struct {
	APIKey      string `mapstructure:"apiKey"`
	SenderEmail string `mapstructure:"senderEmail"`
	SenderName  string `mapstructure:"senderName"`
	SMSSender   string `mapstructure:"smsSender"`
}

BrevoConfig holds Brevo (formerly Sendinblue) specific configuration.

type Config

type Config struct {
	Log      LogConfig      `mapstructure:"log"`
	Adapter  AdapterConfig  `mapstructure:"adapter"`
	SendGrid SendGridConfig `mapstructure:"sendgrid"`
	Twilio   TwilioConfig   `mapstructure:"twilio"`
	Telegram TelegramConfig `mapstructure:"telegram"`
	Brevo    BrevoConfig    `mapstructure:"brevo"`
}

Config stores all configuration of the application.

func LoadConfig

func LoadConfig(path string) (config Config, err error)

LoadConfig reads configuration from a YAML file or environment variables.

type EmailProvider

type EmailProvider string
const (
	EmailSendGrid EmailProvider = "sendgrid"
	EmailBrevo    EmailProvider = "brevo"
	EmailMock     EmailProvider = "mock"
)

type LogConfig

type LogConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

LogConfig stores logging-specific configuration.

type NotifyChannel

type NotifyChannel string
const (
	NotifyMock     NotifyChannel = "mock"
	NotifyTelegram NotifyChannel = "telegram"
	NotifySlack    NotifyChannel = "slack"
)

type SMSProvider

type SMSProvider string
const (
	SMSProviderTwilio SMSProvider = "twilio"
	SMSProviderBrevo  SMSProvider = "brevo"
	SMSProviderMock   SMSProvider = "mock"
)

type SendGridConfig

type SendGridConfig struct {
	APIKey    string `mapstructure:"apiKey"`
	FromEmail string `mapstructure:"fromEmail"`
	FromName  string `mapstructure:"fromName"`
}

SendGridConfig holds SendGrid specific configuration.

type TelegramConfig

type TelegramConfig struct {
	BotToken string `mapstructure:"botToken"`
	ChatID   string `mapstructure:"chatId"`
	Debug    bool   `mapstructure:"debug"`
}

TelegramConfig holds Telegram specific configuration.

type TwilioConfig

type TwilioConfig struct {
	AccountSid   string `mapstructure:"accountSid"`
	AuthToken    string `mapstructure:"authToken"`
	FromNumber   string `mapstructure:"fromNumber"`
	MessagingSid string `mapstructure:"messagingSid"`
}

TwilioConfig holds Twilio specific configuration.

Jump to

Keyboard shortcuts

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