config

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatConfig

type ChatConfig struct {
	Handle          string         `yaml:"handle"`
	AcceptedFormats []string       `yaml:"accepted_formats,omitempty"`
	Storage         *StorageConfig `yaml:"storage,omitempty"`
}

type Config

type Config struct {
	Telegram TelegramConfig `yaml:"telegram"`
	Defaults DefaultsConfig `yaml:"defaults"`
	Paths    PathsConfig    `yaml:"paths"`
	Chats    []ChatConfig   `yaml:"chats"`
}

Config is the top-level configuration loaded from YAML.

func Load

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

Load reads the YAML config file, applies defaults, and validates.

type DefaultsConfig

type DefaultsConfig struct {
	AcceptedFormats []string      `yaml:"accepted_formats"`
	Storage         StorageConfig `yaml:"storage"`
}

type DropboxConfig

type DropboxConfig struct {
	AppKey     string `yaml:"app_key"`
	AppSecret  string `yaml:"app_secret"`
	TokenFile  string `yaml:"token_file"`
	UploadPath string `yaml:"upload_path"`
}

type PathsConfig

type PathsConfig struct {
	DownloadDir  string `yaml:"download_dir"`
	ConvertedDir string `yaml:"converted_dir"`
}

type ResolvedChat

type ResolvedChat struct {
	Handle          string
	AcceptedFormats map[string]bool
	Storage         StorageConfig
}

ResolvedChat holds the fully-merged configuration for a single monitored chat.

func ResolvedChatConfig

func ResolvedChatConfig(defaults DefaultsConfig, chat ChatConfig) ResolvedChat

ResolvedChatConfig merges per-chat overrides onto global defaults.

type StorageConfig

type StorageConfig struct {
	Type    string        `yaml:"type"`
	Dropbox DropboxConfig `yaml:"dropbox"`
}

type TelegramConfig

type TelegramConfig struct {
	AppID   int    `yaml:"app_id"`
	AppHash string `yaml:"app_hash"`
}

Jump to

Keyboard shortcuts

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