config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultConfig

func CreateDefaultConfig(path string) error

CreateDefaultConfig creates a default configuration file

Types

type APIConfig

type APIConfig struct {
	TMDB TMDBConfig `yaml:"tmdb"`
}

type Config

type Config struct {
	API     APIConfig     `yaml:"api"`
	Scanner ScannerConfig `yaml:"scanner"`
	Renamer RenamerConfig `yaml:"renamer"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

LoadConfig loads the configuration from a YAML file

func (*Config) Validate

func (c *Config) Validate() error

validate performs comprehensive validation of the configuration

type MediaType

type MediaType string
const (
	Movie  MediaType = "movie"
	TvShow MediaType = "tvshow"
)

type PatternConfig

type PatternConfig struct {
	Movie  string `yaml:"movie"`
	TVShow string `yaml:"tvshow"`
}

type RenamerConfig

type RenamerConfig struct {
	DryRun     bool          `yaml:"dry_run"`
	Type       MediaType     `yaml:"type"`
	Patterns   PatternConfig `yaml:"patterns"`
	MaxResults int           `yaml:"max_results"`
	QuickMode  bool          `yaml:"quick_mode"`
}

type ScannerConfig

type ScannerConfig struct {
	MediaPath       string `yaml:"media_path"`
	Recursive       bool   `yaml:"recursive"`
	IncludeNotFound bool   `yaml:"include_not_found"`
}

type TMDBConfig

type TMDBConfig struct {
	Key      string `yaml:"key"`
	Language string `yaml:"language"`
}

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a configuration validation error

func (ValidationError) Error

func (e ValidationError) Error() string

type ValidationErrors

type ValidationErrors []ValidationError

ValidationErrors holds multiple validation errors

func (ValidationErrors) Error

func (e ValidationErrors) Error() string

Jump to

Keyboard shortcuts

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