config

package
v0.0.0-...-01a7dd6 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config loads the service configuration from environment variables, composing the SMTP and RabbitMQ configs already provided by go-types with the two values that belong to this service: the destination address and the queue to consume from.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingDestination = errors.New("DESTINATION env variable must be set")

ErrMissingDestination is returned when the DESTINATION env variable is not set.

Functions

This section is empty.

Types

type Config

type Config struct {
	SMTPConfig  *smtpconfig.Config
	Destination string

	NotifyQueue    string
	RabbitmqConfig *rabbitmqconfig.Config
}

Config holds everything the composition root needs to wire the service: where to consume from (RabbitMQ + queue) and where to deliver to (SMTP + destination address).

func NewConfig

func NewConfig(ctx context.Context) (*Config, error)

NewConfig reads and validates the environment: DESTINATION must be a valid e-mail address, the SMTP_* and RABBITMQ_* groups are validated by their go-types constructors, and NOTIFY_QUEUE_NAME falls back to "home-ip-monitor-notifications", the monitor's default notification queue.

Jump to

Keyboard shortcuts

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