lib

package
v5.0.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilLoggerPtr        = NewError("nil log.Logger pointer")
	ErrNilDGoSession       = NewError("nil discordgo session")
	ErrDiscordDisconnected = NewError("discord disconnected")
	ErrIncorrectNowPlaying = NewError("incorrect ctrack.NowPlaying")
)

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(configPath string, stdl, errl *log.Logger) (App, error)

func (App) Run

func (a App) Run() error

type AppConfig

type AppConfig struct {
	Title       string `toml:"title"`
	FirstLine   string `toml:"first_line"`
	SecondLine  string `toml:"second_line"`
	LargeImage  string `toml:"large_image"`
	LargeText   string `toml:"large_text"`
	SmallImage  string `toml:"small_image"`
	SmallText   string `toml:"small_text"`
	ShowButton  bool   `toml:"show_button"`
	EndlessMode bool   `toml:"endless_mode"`
}

type AppStatusUpdater

type AppStatusUpdater struct {
	// contains filtered or unexported fields
}

func NewAppStatusUpdater

func NewAppStatusUpdater(app *App) *AppStatusUpdater

func (*AppStatusUpdater) Clear

func (*AppStatusUpdater) Clear() error

func (*AppStatusUpdater) Login

func (*AppStatusUpdater) Login(id string) error

func (*AppStatusUpdater) Logout

func (*AppStatusUpdater) Logout() error

func (*AppStatusUpdater) Set

func (a *AppStatusUpdater) Set(t RT) error

type Config

type Config struct {
	LastFM  LastFMConfig  `toml:"lastfm"`
	Discord DiscordConfig `toml:"discord"`
	App     AppConfig     `toml:"app"`
}

func ParseConfig

func ParseConfig(path string) (Config, error)

type DiscordConfig

type DiscordConfig struct {
	UseAppMode bool   `toml:"use_app_mode"`
	Token      string `toml:"token"`
	AppID      int    `toml:"app_id"`
}

type Error

type Error struct {
	// contains filtered or unexported fields
}

func ErrEmptyField

func ErrEmptyField(field string) Error

func NewError

func NewError(text string) Error

func (Error) Error

func (e Error) Error() string

func (Error) IsEmptyField

func (e Error) IsEmptyField() bool

type LastFMConfig

type LastFMConfig struct {
	APIKey        string `toml:"api_key"`
	Username      string `toml:"username"`
	CheckInterval int    `toml:"check_interval"`
}

type RT

type StatusUpdater

type StatusUpdater interface {
	Login(string) error
	Logout() error
	Set(RT) error
	Clear() error
}

type TokenModeStatusUpdater

type TokenModeStatusUpdater struct {
	Session *dgo.Session
	// contains filtered or unexported fields
}

func NewTokenModeStatusUpdater

func NewTokenModeStatusUpdater(app *App) *TokenModeStatusUpdater

func (*TokenModeStatusUpdater) Clear

func (tmsu *TokenModeStatusUpdater) Clear() error

func (*TokenModeStatusUpdater) Login

func (tmsu *TokenModeStatusUpdater) Login(token string) error

func (*TokenModeStatusUpdater) Logout

func (tmsu *TokenModeStatusUpdater) Logout() error

func (*TokenModeStatusUpdater) Set

func (tmsu *TokenModeStatusUpdater) Set(t RT) error

Jump to

Keyboard shortcuts

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