config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EdgeTTSServiceName  = "edge"
	AzureTTSServiceName = "azure"
)
View Source
const (
	DefaultJobTimeout              = 30 * time.Minute
	DefaultStorageOperationTimeout = 2 * time.Minute
)
View Source
const CurrentVersion = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version          int                        `yaml:"version"`
	Runtime          RuntimeConfig              `yaml:"runtime"`
	Services         ServicesConfig             `yaml:"services"`
	DialogueProfiles map[string]DialogueProfile `yaml:"dialogue_profiles"`
	Defaults         DefaultsConfig             `yaml:"defaults"`
	Sources          []SourceConfig             `yaml:"sources"`
}

func Load

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

func (*Config) EffectiveContent

func (c *Config) EffectiveContent(source SourceConfig) ContentConfig

func (*Config) EffectiveGeneration

func (c *Config) EffectiveGeneration(source SourceConfig) GenerationConfig

func (*Config) EffectiveLLM

func (c *Config) EffectiveLLM(source SourceConfig) []string

func (*Config) EffectiveLimits

func (c *Config) EffectiveLimits(source SourceConfig) LimitsConfig

func (*Config) EffectivePodcast

func (c *Config) EffectivePodcast(source SourceConfig) PodcastConfig

func (*Config) Source

func (c *Config) Source(id string) (SourceConfig, bool)

func (*Config) Validate

func (c *Config) Validate() error

type ContentConfig

type ContentConfig struct {
	Type string           `yaml:"type"`
	URL  URLMappingConfig `yaml:"url"`
}

type ContentServices

type ContentServices struct {
	Jina JinaService `yaml:"jina"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Type     string `yaml:"type"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Name     string `yaml:"name"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	SSLMode  string `yaml:"ssl_mode"`
}

func (DatabaseConfig) URL

func (c DatabaseConfig) URL() string

type DefaultsConfig

type DefaultsConfig struct {
	Schedule   ScheduleConfig   `yaml:"schedule"`
	LLM        []string         `yaml:"llm"`
	Generation GenerationConfig `yaml:"generation"`
	Content    ContentConfig    `yaml:"content"`
	Limits     LimitsConfig     `yaml:"limits"`
	Podcast    PodcastConfig    `yaml:"podcast"`
}

type DialogueProfile

type DialogueProfile struct {
	Rate     string          `yaml:"rate" json:"rate"`
	Volume   string          `yaml:"volume" json:"volume"`
	Pitch    string          `yaml:"pitch" json:"pitch"`
	Speakers []SpeakerConfig `yaml:"speakers" json:"speakers"`
}

type FeedConfig

type FeedConfig struct {
	URL string `yaml:"url" json:"url"`
}

type GenerationConfig

type GenerationConfig struct {
	TargetDuration  string `yaml:"target_duration" json:"target_duration"`
	PromptTemplate  string `yaml:"prompt_template" json:"prompt_template"`
	DialogueProfile string `yaml:"dialogue_profile" json:"dialogue_profile"`
}

type HTTPConfig

type HTTPConfig struct {
	Listen           string `yaml:"listen"`
	ManagementListen string `yaml:"management_listen"`
}

func (HTTPConfig) ManagementAddress

func (c HTTPConfig) ManagementAddress() string

type JinaService

type JinaService struct {
	BaseURL string `yaml:"base_url"`
	APIKey  string `yaml:"api_key"`
	Proxy   string `yaml:"proxy"`
	Timeout string `yaml:"timeout"`
	Format  string `yaml:"format"`
}

type JobsConfig

type JobsConfig struct {
	Type    string                 `yaml:"type"`
	Timeout string                 `yaml:"timeout"`
	Queues  map[string]QueueConfig `yaml:"queues"`
}

func (JobsConfig) TimeoutDuration

func (c JobsConfig) TimeoutDuration() (time.Duration, error)

type LLMService

type LLMService struct {
	Type    string `yaml:"type"`
	BaseURL string `yaml:"base_url"`
	APIKey  string `yaml:"api_key"`
	Model   string `yaml:"model"`
	Proxy   string `yaml:"proxy"`
	Timeout string `yaml:"timeout"`
}

type LimitsConfig

type LimitsConfig struct {
	MaxFeedItemsPerRun  int `yaml:"max_feed_items_per_run"`
	MaxDocumentsPerItem int `yaml:"max_documents_per_item"`
}

type PodcastConfig

type PodcastConfig struct {
	MaxAge string `yaml:"max_age" json:"max_age"`
}

type QueueConfig

type QueueConfig struct {
	Concurrency int `yaml:"concurrency"`
}

type RuntimeConfig

type RuntimeConfig struct {
	HTTP     HTTPConfig     `yaml:"http"`
	Database DatabaseConfig `yaml:"database"`
	Jobs     JobsConfig     `yaml:"jobs"`
	Storage  StorageConfig  `yaml:"storage"`
}

type ScheduleConfig

type ScheduleConfig struct {
	Timezone string `yaml:"timezone"`
	Cron     string `yaml:"cron"`
}

type ServicesConfig

type ServicesConfig struct {
	Content ContentServices       `yaml:"content"`
	LLM     map[string]LLMService `yaml:"llm"`
	TTS     map[string]TTSService `yaml:"tts"`
}

type SourceConfig

type SourceConfig struct {
	ID         string            `yaml:"id" json:"id"`
	Name       string            `yaml:"name" json:"name"`
	Enabled    bool              `yaml:"enabled" json:"enabled"`
	Feed       FeedConfig        `yaml:"feed" json:"feed"`
	Schedule   ScheduleConfig    `yaml:"schedule" json:"schedule"`
	Content    *ContentConfig    `yaml:"content" json:"content,omitempty"`
	Generation *GenerationConfig `yaml:"generation" json:"generation,omitempty"`
	LLM        []string          `yaml:"llm" json:"llm,omitempty"`
	Limits     *LimitsConfig     `yaml:"limits" json:"limits,omitempty"`
	Podcast    *PodcastConfig    `yaml:"podcast" json:"podcast,omitempty"`
}

type SpeakerConfig

type SpeakerConfig struct {
	ID    string `yaml:"id" json:"id"`
	Name  string `yaml:"name" json:"name"`
	Role  string `yaml:"role" json:"role"`
	Voice string `yaml:"voice" json:"voice"`
}

type SpeakerVoice

type SpeakerVoice struct {
	Service string
	Voice   string
	Talker  string
}

func ParseSpeakerVoice

func ParseSpeakerVoice(value string) (SpeakerVoice, error)

func (SpeakerVoice) IsMultiTalker

func (v SpeakerVoice) IsMultiTalker() bool

type StorageConfig

type StorageConfig struct {
	Type               string `yaml:"type"`
	Endpoint           string `yaml:"endpoint"`
	Region             string `yaml:"region"`
	AccessKey          string `yaml:"access_key"`
	SecretKey          string `yaml:"secret_key"`
	PrivateBucket      string `yaml:"private_bucket"`
	MediaBucket        string `yaml:"media_bucket"`
	ForcePathStyle     bool   `yaml:"force_path_style"`
	PublicMediaBaseURL string `yaml:"public_media_base_url"`
	Timeout            string `yaml:"timeout"`
}

func (StorageConfig) TimeoutDuration

func (c StorageConfig) TimeoutDuration() (time.Duration, error)

type TTSService

type TTSService struct {
	Proxy          string `yaml:"proxy"`
	ConnectTimeout string `yaml:"connect_timeout"`
	ReceiveTimeout string `yaml:"receive_timeout"`
	Endpoint       string `yaml:"endpoint"`
	Region         string `yaml:"region"`
	APIKey         string `yaml:"api_key"`
	OutputFormat   string `yaml:"output_format"`
}

func (TTSService) AzureEndpoint

func (c TTSService) AzureEndpoint() string

type URLMappingConfig

type URLMappingConfig struct {
	From     string `yaml:"from"`
	Regex    string `yaml:"regex"`
	Template string `yaml:"template"`
}

Jump to

Keyboard shortcuts

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