commander

package
v0.0.0-...-ec66866 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAnotherTaskInProgess = errors.New("another task in progress")

	ErrBootedBefore = errors.New("booted before")
)

Functions

func Boot

func Boot(dataPath string) error

func CancelTask

func CancelTask()

func CrossShot

func CrossShot(snapshotId, targetRemoteName string) (string, error)

Transfer snapshot to any account. Returns new snapshot ID.

func DebugExecInfiniteTask

func DebugExecInfiniteTask() error

func DebugFuckup

func DebugFuckup() error

func DeleteAccount

func DeleteAccount(id string) error

func DeleteAllPlaylists

func DeleteAllPlaylists(accountID string) error

func LinkerCleanAlbums

func LinkerCleanAlbums() error

Delete entities.

func LinkerCleanArtists

func LinkerCleanArtists() error

Delete entities.

func LinkerCleanTracks

func LinkerCleanTracks() error

Delete entities.

func LinkerEntityURL

func LinkerEntityURL(remoteName, remoteID, entityType string) (string, error)

Get URL of entity.

func LinkerExportAlbumsLinks(dest IoWriter) error

Export linker links.

func LinkerExportArtistsLinks(dest IoWriter) error

Export linker links.

func LinkerExportTracksLinks(dest IoWriter) error

Export linker links.

func LinkerImportAlbumsLinks(from IoReader) error

Import linker links.

func LinkerImportArtistsLinks(from IoReader) error

Import linker links.

func LinkerImportTracksLinks(from IoReader) error

Import linker links.

func LinkerNotMatchedAlbumsCount

func LinkerNotMatchedAlbumsCount(remoteName string) (int, error)

Get count of not matched albums.

func LinkerNotMatchedArtistsCount

func LinkerNotMatchedArtistsCount(remoteName string) (int, error)

Get count of not matched artists.

func LinkerNotMatchedTracksCount

func LinkerNotMatchedTracksCount(remoteName string) (int, error)

Get count of not matched tracks.

func RemoteEnabled

func RemoteEnabled(remoteName string) bool

Remote active and ready for sync & tools?

func SetOnLogger

func SetOnLogger(l OnLogger) error

func SetOnTask

func SetOnTask(cb OnTasker)

func SetOnTaskCancelled

func SetOnTaskCancelled(cb OnTasker)

func SetOnTaskDone

func SetOnTaskDone(cb OnTasker)

func SetRemoteEnabled

func SetRemoteEnabled(remoteName string, val bool) error

func Sync

func Sync() error

Start syncing.

func UnlikeLikedAlbums

func UnlikeLikedAlbums(accountID string) error

func UnlikeLikedArtists

func UnlikeLikedArtists(accountID string) error

func UnlikeLikedTracks

func UnlikeLikedTracks(accountID string) error

func Version

func Version() string

Types

type Account

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

func AccountByID

func AccountByID(id string) (*Account, error)

func (*Account) AddedAt

func (e *Account) AddedAt() string

func (*Account) Alias

func (e *Account) Alias() string

func (*Account) Auth

func (e *Account) Auth() string

func (*Account) ID

func (e *Account) ID() string

func (*Account) SetAlias

func (e *Account) SetAlias(val string) error

func (*Account) SetAuth

func (e *Account) SetAuth(val string) error

func (*Account) Settings

func (e *Account) Settings() (*AccountSettings, error)

type AccountSettings

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

func (*AccountSettings) LikedAlbums

func (e *AccountSettings) LikedAlbums() *SyncSetting

func (*AccountSettings) LikedArtists

func (e *AccountSettings) LikedArtists() *SyncSetting

func (*AccountSettings) LikedTracks

func (e *AccountSettings) LikedTracks() *SyncSetting

func (*AccountSettings) Playlist

func (e *AccountSettings) Playlist(playlistID string) (*PlaylistSyncSettings, error)

func (*AccountSettings) Playlists

func (e *AccountSettings) Playlists() *SyncSetting

type AccountSlice

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

func Accounts

func Accounts(remoteName string) (*AccountSlice, error)

func (*AccountSlice) Item

func (e *AccountSlice) Item(i int) *Account

func (*AccountSlice) Len

func (e *AccountSlice) Len() int

type ConfigDeezer

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

func NewConfigDeezer

func NewConfigDeezer() *ConfigDeezer

func (*ConfigDeezer) Host

func (e *ConfigDeezer) Host() string

func (*ConfigDeezer) Port

func (e *ConfigDeezer) Port() int

func (*ConfigDeezer) SetHost

func (e *ConfigDeezer) SetHost(val string) error

func (*ConfigDeezer) SetPort

func (e *ConfigDeezer) SetPort(val int) error

type ConfigGeneral

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

func NewConfigGeneral

func NewConfigGeneral() *ConfigGeneral

func (*ConfigGeneral) Debug

func (e *ConfigGeneral) Debug() bool

func (*ConfigGeneral) SetDebug

func (e *ConfigGeneral) SetDebug(val bool) error

type ConfigLinker

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

func NewConfigLinker

func NewConfigLinker() *ConfigLinker

func (*ConfigLinker) RecheckMissing

func (e *ConfigLinker) RecheckMissing() bool

func (*ConfigLinker) SetRecheckMissing

func (e *ConfigLinker) SetRecheckMissing(val bool) error

type ConfigSnapshots

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

func NewConfigSnapshots

func NewConfigSnapshots() *ConfigSnapshots

func (*ConfigSnapshots) AutoRecover

func (e *ConfigSnapshots) AutoRecover() bool

func (*ConfigSnapshots) CreateWhenSyncing

func (e *ConfigSnapshots) CreateWhenSyncing() bool

func (*ConfigSnapshots) MaxAuto

func (e *ConfigSnapshots) MaxAuto() int

func (*ConfigSnapshots) SetAutoRecover

func (e *ConfigSnapshots) SetAutoRecover(val bool) error

func (*ConfigSnapshots) SetCreateWhenSyncing

func (e *ConfigSnapshots) SetCreateWhenSyncing(val bool) error

func (*ConfigSnapshots) SetMaxAuto

func (e *ConfigSnapshots) SetMaxAuto(val int) error

type ConfigSpotify

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

func NewConfigSpotify

func NewConfigSpotify() *ConfigSpotify

func (*ConfigSpotify) Host

func (e *ConfigSpotify) Host() string

func (*ConfigSpotify) Port

func (e *ConfigSpotify) Port() int

func (*ConfigSpotify) SetHost

func (e *ConfigSpotify) SetHost(val string) error

func (*ConfigSpotify) SetPort

func (e *ConfigSpotify) SetPort(val int) error

type Deezer

type Deezer struct {
}

func NewDeezer

func NewDeezer() *Deezer

func (Deezer) NewAccount

func (e Deezer) NewAccount(alias, clientID, clientSecret string, deadlineSeconds int, onURL OnUrler) (string, error)

func (Deezer) Reauth

func (e Deezer) Reauth(accountId, clientID string, clientSecret string, deadlineSeconds int, onURL OnUrler) error

func (Deezer) RemoteName

func (e Deezer) RemoteName() string

type IoReader

type IoReader interface {
	Read(p []byte) (n int, err error)
}

https://pkg.go.dev/io#Reader

type IoWriter

type IoWriter interface {
	Write(p []byte) (n int, err error)
}

https://pkg.go.dev/io#Writer

type Linked

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

func (Linked) EntityID

func (e Linked) EntityID() string

Get entity id.

func (Linked) RemoteID

func (e Linked) RemoteID() string

If missing - returns empty string.

func (Linked) SetRemoteID

func (e Linked) SetRemoteID(id string) error

Set remote ID (aka relink). If empty - marks as missing.

type LinkedSlice

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

func LinkerLinksAlbums

func LinkerLinksAlbums(remoteName string) (*LinkedSlice, error)

Albums links.

func LinkerLinksArtists

func LinkerLinksArtists(remoteName string) (*LinkedSlice, error)

Artists links.

func LinkerLinksTracks

func LinkerLinksTracks(remoteName string) (*LinkedSlice, error)

Tracks links.

func (*LinkedSlice) Item

func (e *LinkedSlice) Item(i int) *Linked

func (*LinkedSlice) Len

func (e *LinkedSlice) Len() int

type OnLogger

type OnLogger interface {
	OnLog(level int, msg string)
}

type OnTasker

type OnTasker interface {
	Callback()
}

type OnUrlCoder

type OnUrlCoder interface {
	OnUrlCode(url, code string)
}

type OnUrler

type OnUrler interface {
	OnURL(string)
}

type PlaylistSyncSettings

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

func (*PlaylistSyncSettings) Description

func (e *PlaylistSyncSettings) Description() *SyncSetting

func (*PlaylistSyncSettings) Name

func (e *PlaylistSyncSettings) Name() *SyncSetting

func (*PlaylistSyncSettings) Tracks

func (e *PlaylistSyncSettings) Tracks() *SyncSetting

func (*PlaylistSyncSettings) Visibility

func (e *PlaylistSyncSettings) Visibility() *SyncSetting

type Snapshot

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

func CreateSnapshot

func CreateSnapshot(
	alias string,
	accountID string,
	likedAlbums, likedArtists, likedTracks, playlists bool) (*Snapshot, error)

func SnapshotByID

func SnapshotByID(id string) (*Snapshot, error)

func (Snapshot) Alias

func (e Snapshot) Alias() string

func (Snapshot) Auto

func (e Snapshot) Auto() bool

func (Snapshot) CreatedAt

func (e Snapshot) CreatedAt() string

func (*Snapshot) Delete

func (e *Snapshot) Delete() error

func (Snapshot) ID

func (e Snapshot) ID() string

func (Snapshot) LikedAlbumsCount

func (e Snapshot) LikedAlbumsCount() (int, error)

func (Snapshot) LikedAlbumsRestoreable

func (e Snapshot) LikedAlbumsRestoreable() bool

func (Snapshot) LikedArtistsCount

func (e Snapshot) LikedArtistsCount() (int, error)

func (Snapshot) LikedArtistsRestoreable

func (e Snapshot) LikedArtistsRestoreable() bool

func (Snapshot) LikedTracksCount

func (e Snapshot) LikedTracksCount() (int, error)

func (Snapshot) LikedTracksRestoreable

func (e Snapshot) LikedTracksRestoreable() bool

func (Snapshot) Playlist

func (e Snapshot) Playlist(id string) (*SnapshotPlaylist, error)

func (Snapshot) Playlists

func (e Snapshot) Playlists() (*SnapshotPlaylistSlice, error)

func (Snapshot) PlaylistsCount

func (e Snapshot) PlaylistsCount() (int, error)

func (Snapshot) PlaylistsRestoreable

func (e Snapshot) PlaylistsRestoreable() bool

func (Snapshot) RestoreLikedAlbums

func (e Snapshot) RestoreLikedAlbums(merge bool, accountID string) error

func (Snapshot) RestoreLikedArtists

func (e Snapshot) RestoreLikedArtists(merge bool, accountID string) error

func (Snapshot) RestoreLikedTracks

func (e Snapshot) RestoreLikedTracks(merge bool, accountID string) error

func (Snapshot) RestorePlaylists

func (e Snapshot) RestorePlaylists(merge bool, accountID string) error

func (Snapshot) SetAlias

func (e Snapshot) SetAlias(val string) error

type SnapshotPlaylist

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

func (*SnapshotPlaylist) Delete

func (e *SnapshotPlaylist) Delete() error

func (SnapshotPlaylist) Description

func (e SnapshotPlaylist) Description() string

func (SnapshotPlaylist) ID

func (e SnapshotPlaylist) ID() string

func (SnapshotPlaylist) IsVisible

func (e SnapshotPlaylist) IsVisible() bool

func (SnapshotPlaylist) Name

func (e SnapshotPlaylist) Name() string

func (SnapshotPlaylist) Restore

func (e SnapshotPlaylist) Restore(accountID string) error

type SnapshotPlaylistSlice

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

func (SnapshotPlaylistSlice) Item

func (SnapshotPlaylistSlice) Len

func (e SnapshotPlaylistSlice) Len() int

type SnapshotSlice

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

func Snapshots

func Snapshots(remoteName, filterAuto string) (*SnapshotSlice, error)

func (SnapshotSlice) Item

func (e SnapshotSlice) Item(i int) *Snapshot

func (SnapshotSlice) Len

func (e SnapshotSlice) Len() int

type Spotify

type Spotify struct {
}

func NewSpotify

func NewSpotify() *Spotify

func (Spotify) NewAccount

func (e Spotify) NewAccount(alias, clientID, clientSecret string, deadlineSeconds int, onURL OnUrler) (string, error)

func (Spotify) Reauth

func (e Spotify) Reauth(accountId, clientID string, clientSecret string, deadlineSeconds int, onURL OnUrler) error

func (Spotify) RemoteName

func (e Spotify) RemoteName() string

type SyncSetting

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

func (*SyncSetting) LastSynchronization

func (e *SyncSetting) LastSynchronization() string

func (*SyncSetting) SetSynchronize

func (e *SyncSetting) SetSynchronize(val bool) error

func (*SyncSetting) Synchronize

func (e *SyncSetting) Synchronize() bool

type VkMusic

type VkMusic struct {
}

func NewVkMusic

func NewVkMusic() *VkMusic

func (VkMusic) NewAccount

func (e VkMusic) NewAccount(
	alias,
	phone string,
	password string,
	onCode VkMusicOnCode,
	deadlineSeconds int,
) (string, error)

func (VkMusic) Reauth

func (e VkMusic) Reauth(
	accountId,
	phone,
	password string,
	onCode VkMusicOnCode,
	deadlineSeconds int,
) error

func (VkMusic) RemoteName

func (e VkMusic) RemoteName() string

type VkMusicOnCode

type VkMusicOnCode interface {
	Got(currentMethod, resendMethod string) VkMusicOnCodeGetter
}

type VkMusicOnCodeGetter

type VkMusicOnCodeGetter interface {
	Code() (string, error)
	Resend() bool
}

type YandexMusic

type YandexMusic struct {
}

func NewYandexMusic

func NewYandexMusic() *YandexMusic

func (YandexMusic) NewAccount

func (e YandexMusic) NewAccount(alias string, deadlineSeconds int, onUrlCode OnUrlCoder) (string, error)

func (YandexMusic) Reauth

func (e YandexMusic) Reauth(accountId string, login string, deadlineSeconds int, onURL OnUrlCoder) error

func (YandexMusic) RemoteName

func (e YandexMusic) RemoteName() string

type Zvuk

type Zvuk struct {
}

func NewZvuk

func NewZvuk() *Zvuk

func (Zvuk) NewAccount

func (e Zvuk) NewAccount(alias, token string) (string, error)

func (Zvuk) Reauth

func (e Zvuk) Reauth(accountId, token string) error

func (Zvuk) RemoteName

func (e Zvuk) RemoteName() string

Jump to

Keyboard shortcuts

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