config

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const VersionDev = "dev"

Variables

This section is empty.

Functions

func Version

func Version() string

Version returns the version of the build. If the version is not set, it returns VersionDev

The version is set by the build system:

go build \
  -ldflags "-X '${MODULE}/internal/config.version=${BUILD_VERSION}'" \
  -o ${DEST} ${SRC}

Types

type Config

type Config struct {
	DB
	Telegram
	Settings
}

func Default

func Default() Config

Default returns default configuration

func Load

func Load() (Config, error)

Load loads configuration from Default and environment variables

type DB

type DB struct {
	Filepath string `env:"DB_FILEPATH,required"` // Path to database file
	Version  uint   // Required database schema version
}

DB is SQLite database configuration

type Settings

type Settings struct {
	PublicUrl url.URL `env:"PUBLIC_URL,required"` // Public URL where the public directory is accessible (used in feed)
	PublicDir string  `env:"PUBLIC_DIR,required"` // Path to public directory where feed and media files are stored

	// Download configuration
	DownloadDir     string                `env:"DOWNLOAD_DIR,required"` // Path to temporary download directory
	DownloadTimeout time.Duration         `env:"DOWNLOAD_TIMEOUT"`      // Timeout for downloading media
	DownloadFormat  domain.DownloadFormat `env:"DOWNLOAD_FORMAT"`       // Media download format by default (mp3 or m4a)
	DownloadQuality string                `env:"DOWNLOAD_QUALITY"`      // Media download quality by default (e.g., 192k)
	DownloadWorkers int                   `env:"DOWNLOAD_WORKERS"`      // Number of concurrent download workers
	ThumbnailSize   int                   `env:"THUMBNAIL_SIZE"`        // Size of the square thumbnail to generate (in pixels)

	// External tools configuration
	YtDlpPath  string `env:"YT_DLP_PATH"` // Path to yt-dlp executable
	FFMpegPath string `env:"FFMPEG_PATH"` // Path to ffmpeg executable

	// RSS feed configuration
	FeedFileName    string   `env:"FEED_FILENAME"`     // Name of the RSS feed file (will be created in PublicDir)
	FeedTitle       string   `env:"FEED_TITLE"`        // Title of the RSS feed
	FeedDescription string   `env:"FEED_DESC"`         // Description of the RSS feed
	FeedImage       string   `env:"FEED_IMAGE"`        // URL of the RSS feed cover image
	FeedLanguage    string   `env:"FEED_LANGUAGE"`     // Language of the RSS feed (e.g., en)
	FeedCategories  []string `env:"FEED_CATEGORIES"`   // Categories of the RSS feed
	FeedCategories2 []string `env:"FEED_CATEGORIES2"`  // Additional categories of the RSS feed
	FeedCategories3 []string `env:"FEED_CATEGORIES3"`  // Additional categories of the RSS feed
	FeedIsExplicit  bool     `env:"FEED_IS_EXPLICIT"`  // Whether the feed contains explicit content
	FeedAuthor      string   `env:"FEED_AUTHOR"`       // Author of the RSS feed
	FeedLink        string   `env:"FEED_LINK"`         // Link to the website of the RSS feed
	FeedKeywords    string   `env:"FEED_KEYWORDS"`     // Comma-separated keywords for the RSS feed
	FeedMaxEpisodes int      `env:"FEED_MAX_EPISODES"` // Maximum number of episodes to keep in the feed (0 means no limit)
}

Settings - application settings

type Telegram

type Telegram struct {
	BotToken     string  `env:"TELEGRAM_BOT_TOKEN,required,unset"`
	AllowedUsers []int64 `env:"TELEGRAM_ALLOWED_USERS,required"`
}

Telegram bot configuration

Jump to

Keyboard shortcuts

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