config

package
v0.0.0-...-30262a5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config represents the configuration for mvm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FileRoot string   `toml:"file_root"`
	Importer Importer `toml:"importer"`
	Library  Library  `toml:"library"`
}

Config contains the general configuration of mvm

func Load

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

Load loads a configuration file

type Imdb

type Imdb struct {
	// MaxRequests is the maximum number of parallel requests to imdb
	MaxRequests int `toml:"max_requests"`
}

Imdb contains the configuration related to imdb.com

type Importer

type Importer struct {
	BufferSize int       `toml:"buffer_size"`
	Osdb       Osdb      `toml:"osdb"`
	Imdb       Imdb      `toml:"imdb"`
	Subtitles  Subtitles `toml:"subtitles"`
}

Importer contains the configuration for all importers

type Library

type Library struct {
	Database    string `toml:"database"`
	DatabaseDSN string `toml:"database_dsn"`
}

Library contains the configuration for the library

type Osdb

type Osdb struct {
	// Username for opensubtitles.org (leave blank for no user)
	Username string `toml:"username"`
	// Password for opensubtitles.org (leave blank for no password)
	Password string `toml:"password"`
	// MaxRequests is the maximum number of parallel requests to opensubtitles.org
	MaxRequests int `toml:"max_requests"`
	// MaxMoviesPerRequest is the maximum number of movies to ask for in a
	// single request. Currently, opensubtitles limits this to 200
	MaxMoviesPerRequest int `toml:"max_movies_per_request"`
	// MaxSubtitlesPerRequest is the maximum number of subtitles to ask for in a
	// single request. Currently, opensubtitles limits this to 20
	MaxSubtitlesPerRequest int `toml:"max_subtitles_per_request"`
}

Osdb contains the configuration related to the opensubtitles.org api

type Subtitles

type Subtitles struct {
	Languages            types.Languages `toml:"languages"`
	Filename             *types.Template `toml:"filename"`
	SubtitlesPerLanguage int             `toml:"subtitles_per_language"`
}

Subtitles contains the configuration for the subtitle downloader

Jump to

Keyboard shortcuts

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