config

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DEFAULT_LOGFILE_PATH = "musicbot.log"
	DEFAULT_LOGLEVEL     = "info"
	DEFAULT_QUEUE_PATH   = "queue.txt"
	DEFAULT_STATS_PATH   = "musicbot-stats.json"
)
View Source
const (
	DEFAULT_YOUTUBE_MPV_BIN_PATH   = "mpv"
	DEFAULT_YOUTUBE_MPV_INPUT_PATH = ".yt-mpv-input"
)
View Source
const DEFAULT_API_PORT = 7070
View Source
const DEFAULT_TOKEN_FILE_PATH = ".spotify-token"
View Source
const DEFAULT_WHITELIST_PATH = "whitelist.txt"

Variables

This section is empty.

Functions

func ReadWhitelist

func ReadWhitelist(path string) (list []string, err error)

func WriteWhitelist

func WriteWhitelist(path string, lines []string) (err error)

Types

type API

type API struct {
	Host string
	Port int

	Username string
	Password string
}

type IRC

type IRC struct {
	Server        string
	Ssl           bool
	Channel       string
	Realname      string
	Nick          string
	Password      string
	Master        string
	WhiteListPath string
}

type MusicBot

type MusicBot struct {
	LogFile   string
	LogLevel  string
	QueuePath string
	StatsPath string

	IRC           IRC
	API           API
	YoutubePlayer YoutubePlayer
	SpotifyPlayer SpotifyPlayer
}

func ReadConfig

func ReadConfig(path string) (conf *MusicBot, err error)

func (*MusicBot) ApplyDefaults

func (c *MusicBot) ApplyDefaults()

type SpotifyPlayer

type SpotifyPlayer struct {
	Enabled        bool
	ClientID       string
	ClientSecret   string
	TokenFilePath  string
	PlaybackDevice string
}

type YoutubePlayer

type YoutubePlayer struct {
	Enabled bool

	MpvBinPath    string
	MpvInputPath  string
	YoutubeAPIKey string
}

Jump to

Keyboard shortcuts

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