config

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig added in v0.9.0

type AdminConfig struct {
	TOTPSecret string
}

AdminConfig is environment-only; an empty secret disables all admin routes.

func (AdminConfig) SecretBytes added in v0.9.0

func (c AdminConfig) SecretBytes() ([]byte, error)

func (AdminConfig) Validate added in v0.9.0

func (c AdminConfig) Validate() error

type Config

type Config struct {
	Admin            AdminConfig                `yaml:"-" json:"-"`
	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"`
	Jina      JinaContentConfig      `yaml:"jina"`
	Crawl4AI  Crawl4AIContentConfig  `yaml:"crawl4ai"`
	Transform ContentTransformConfig `yaml:"transform"`
}

type ContentServices

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

type ContentTransformConfig added in v0.4.0

type ContentTransformConfig struct {
	Type string `yaml:"type"`
}

type Crawl4AIContentConfig added in v0.4.0

type Crawl4AIContentConfig struct {
	Mode     *string `yaml:"mode"`
	BaseURL  *string `yaml:"base_url"`
	APIToken *string `yaml:"api_token"`
	Proxy    *string `yaml:"proxy"`
	Timeout  *string `yaml:"timeout"`
	Filter   *string `yaml:"filter"`
}

func (Crawl4AIContentConfig) EffectiveService added in v0.4.0

func (c Crawl4AIContentConfig) EffectiveService(service Crawl4AIService) Crawl4AIService

type Crawl4AIService added in v0.4.0

type Crawl4AIService struct {
	BaseURL  string `yaml:"base_url"`
	APIToken string `yaml:"api_token"`
	Proxy    string `yaml:"proxy"`
	Timeout  string `yaml:"timeout"`
	Mode     string `yaml:"mode"`
	Filter   string `yaml:"filter"`
}

func (Crawl4AIService) EffectiveFilter added in v0.4.0

func (s Crawl4AIService) EffectiveFilter() string

func (Crawl4AIService) EffectiveMode added in v0.4.0

func (s Crawl4AIService) EffectiveMode() string

func (Crawl4AIService) TimeoutDuration added in v0.4.0

func (s Crawl4AIService) TimeoutDuration() (time.Duration, error)

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"`
	NoticeFile       string `yaml:"notice_file"`
}

func (HTTPConfig) ManagementAddress

func (c HTTPConfig) ManagementAddress() string

type JinaContentConfig added in v0.4.0

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

func (JinaContentConfig) EffectiveService added in v0.4.0

func (c JinaContentConfig) EffectiveService(service JinaService) JinaService

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"`
}

func (JinaService) TimeoutDuration added in v0.4.0

func (s JinaService) TimeoutDuration() (time.Duration, error)

type JobsConfig

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

func (JobsConfig) FetchPollIntervalDuration added in v0.2.2

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

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