core

package
v0.0.0-...-41e9194 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Connection struct {
		Server   string `json:"server"`
		Port     int    `json:"port"`
		Database string `json:"database"`
		Username string `json:"username"`
		Password string `json:"password"`
	} `json:"connection"`
	ServerPaths struct {
		Log        string `json:"log"`
		Backup     string `json:"backup"`
		YoutubeDL  string `json:"youtube-dl"`
		Thumbnails string `json:"thumbnails"`
		Videos     string `json:"videos"`
	} `json:"server-paths"`
	ClientPaths struct {
		Log        string `json:"log"`
		Thumbnails string `json:"thumbnails"`
		Videos     string `json:"videos"`
	} `json:"client-paths"`
	Logs struct {
		Backup   string `json:"backup"`
		Update   string `json:"update"`
		Download string `json:"download"`
		SoftTube string `json:"softtube"`
		Cleanup  string `json:"cleanup"`
		Shrink   string `json:"shrink"`
	} `json:"logs"`
	Intervals struct {
		High   int `json:"high"`
		Medium int `json:"medium"`
		Low    int `json:"low"`
	} `json:"intervals"`
}

Config for the SoftTube program

func (*Config) Load

func (config *Config) Load(mode string) error

Load : Loads a SoftTube configuration file

func (*Config) Save

func (config *Config) Save(mode string)

Save : Saves a SoftTube configuration file

type Logger

type Logger struct {
	Path string
	File *os.File
}

Logger : Log file

func NewLog

func NewLog(path string) *Logger

NewLog : Creates and opens the log file

func (*Logger) Close

func (l *Logger) Close()

Close the log file

func (*Logger) Log

func (l *Logger) Log(text string)

Log : Simple log function

func (*Logger) LogError

func (l *Logger) LogError(err error)

LogError : Logs an error

func (*Logger) LogFinished

func (l *Logger) LogFinished(application string)

LogFinished : Write end of log message

func (*Logger) LogFormat

func (l *Logger) LogFormat(v ...interface{})

LogFormat : Logs and formats string

func (*Logger) LogStart

func (l *Logger) LogStart(application string)

LogStart : Write beginning of log message

Jump to

Keyboard shortcuts

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