pkg

package
v0.0.0-...-e82a829 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 1.0

Version 1.0: Initialize CLI

Variables

View Source
var HomeDirectory string

Functions

func IsConfigFileExist

func IsConfigFileExist() bool

Check existence of the configuration file

func IsValidMP3Quality

func IsValidMP3Quality(quality int64) error

func IsValidMP4Quality

func IsValidMP4Quality(quality int64) error

func WriteConfigFile

func WriteConfigFile(cfg *Config) error

Write data of config to the configuration file

func WriteDefaultConfig

func WriteDefaultConfig() error

Write default config into the configuration file

Types

type Config

type Config struct {
	Mp3Quality int64  `json:"mp3_quality"`
	Mp4Quality int64  `json:"mp4_quality"`
	Directory  string `json:"directory"`
}

func ReadConfigFile

func ReadConfigFile() (*Config, error)

Read the configuration

func (*Config) CreateDownloadFolderIfNotExist

func (cfg *Config) CreateDownloadFolderIfNotExist()

Make download directory if it not exist

func (*Config) GetDownloadFolder

func (cfg *Config) GetDownloadFolder() string

Get absolutely path of download folder

func (*Config) IsValidConfig

func (cfg *Config) IsValidConfig() error

Check valid data of the configuration after read successfully

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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