config

package
v0.0.0-...-9174c1b Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenNotSet          = errors.New("bot token not set")
	ErrInvalidYoutubeDlPath = errors.New("invalid youtube-dl path")
	ErrInvalidFfmpegPath    = errors.New("invalid FFmpeg path")
	ErrYoutubeDlNotFound    = errors.New("youtube-dl not found, please install it from https://youtube-dl.org/ first")
	ErrFfmpegNotFound       = errors.New("FFmpeg not found, please install it from https://ffmpeg.org first")
	ErrPythonNotInstalled   = errors.New("python not installed")
)
View Source
var (
	ErrUnsupportedOSAndArch  = errors.New("no download available for your operating system and hardware architecture")
	ErrFileNotFoundInArchive = errors.New("file not found in archive")
	ErrUnsupportedArchive    = errors.New("unsupported archive format (supported are .tar, .tar.gz, .tar.xz and .zip")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Token      string           `toml:"bot-token"`
	FfmpegPath string           `toml:"ffmpeg-path"`
	Extractors extractor.Config `toml:"extractors"`
}

func Autoconf

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

Automatically creates a TOML configuration file with the default values and prints information and instructions for the user to stdout.

func Load

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

Tries to load the given TOML config file. Returns an error if the configuration file does not exist or is invalid.

Jump to

Keyboard shortcuts

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