MCPcopy Create free account

hub / github.com/dinofizz/diskplayer / functions

Functions78 in github.com/dinofizz/diskplayer

↓ 12 callersFunctionConfigValue
ConfigValue returns the configuration value identified by the provided key. If none is found the application quits with an error message and exit code
config.go:26
↓ 9 callersFunctionPlayUri
PlayURI will play the album or playlist Spotify URI that is passed in to the function. An error is returned if one is encountered.
diskplayer.go:36
↓ 6 callersFunctionPause
Pause will pause the Spotify playback if the Diskplayer is the currently active Spotify device. An error is returned if one is encountered.
diskplayer.go:77
↓ 6 callersFunctionerrorPage
errorPage returns an HTML error page, inserting error details into the error.html template.
server.go:137
↓ 5 callersFunctionNewAuthenticator
NewAuthenticator returns a Spotify authenticator object configured with the required callback URL, client IT and client secret. An error is returned i
auth.go:16
↓ 4 callersFunctionNewDiskplayerServer
NewDiskplayerServer returns a new DiskplayerServer instance. The arguments are required if the server instance is to be used to obtain a new Spotify a
server.go:31
↓ 4 callersFunctionPlayPath
PlayPath will play an album or playlist by reading a Spotify URI from a file whose filepath is passed into the function. An error is returned if one i
diskplayer.go:14
↓ 4 callersFunctionReadConfig
ReadConfig reads in the configuration values from the diskplayer.yaml configuration file.
config.go:10
↓ 3 callersFunctionNewToken
NewToken will create a new OAuth2 token request. The user will be prompted to visit a URL, and after access is granted a new OAuth2 token is returned.
auth.go:37
↓ 3 callersMethodPause
()
client.go:16
↓ 3 callersMethodPlayerDevices
()
client.go:15
↓ 3 callersFunctionReadToken
ReadToken will attempt to deserialize a token whose path is defined in the diskplayer.yaml configuration file under the token.file_path field. Returns
auth.go:61
↓ 3 callersFunctionRecord
Record takes in a web URL which links to a Spotify album or playlist and records the corresponding Spotify ID to the filepath specified in the diskpla
recorder.go:14
↓ 3 callersFunctionSaveToken
SaveToken will serialize the provided token and save it to the file whose path is defined in the diskplayer. yaml configuration file under the token.f
auth.go:77
↓ 2 callersMethodAuthenticator
()
server.go:26
↓ 2 callersFunctionNewClient
Returns an authenticated Spotify client object, or an error if encountered.
client.go:9
↓ 2 callersMethodPlayOpt
(opt *spotify.PlayOptions)
client.go:18
↓ 2 callersMethodRunCallbackServer
()
server.go:24
↓ 2 callersMethodTokenChannel
()
server.go:25
↓ 2 callersMethodTransferPlayback
(deviceID spotify.ID, play bool)
client.go:17
↓ 2 callersFunctionactivePlayerId
activePlayerIds iterates through the provided player devices and returns the active ID. If there is no active Spotify client device the ID will be ret
diskplayer.go:106
↓ 2 callersFunctiondiskplayerId
diskplayerId returns the Spotify ID for the Spotify client whose name is provided in the parameter list, or a nil pointer if no matching device is fou
diskplayer.go:118
↓ 1 callersMethodRunRecordServer
()
server.go:23
↓ 1 callersMethodServeHTTP
An implementation of the Handler ServeHTTP function for the CallbackHandler struct.
server.go:149
↓ 1 callersFunctioncreateSpotifyUri
createSpotifyUri creates a Spotify URI from the web URL. The web URL should be something like https://open.spotify.com/album/1S7mumn7D4riEX2gVWYgPO A
recorder.go:31
↓ 1 callersFunctionwriteToDisk
writeToDisk takes a string containing a Spotify URI and writes to the the filepath specified in the diskplayer.yaml configuration file under the recor
recorder.go:48
MethodAuthenticator
()
server.go:78
MethodAuthenticator
Authenticator provides a mock function with given fields:
mocks/DiskplayerServer.go:16
MethodPause
Pause will pause playback for the currently active device.
client.go:32
MethodPause
Pause provides a mock function with given fields:
mocks/Client.go:14
MethodPlayOpt
PlayOpt will initiate playback on the device as specified in the PlayOptions.
client.go:42
MethodPlayOpt
PlayOpt provides a mock function with given fields: opt
mocks/Client.go:28
MethodPlayerDevices
PlayerDevices will return a list of available Spotify devices. An error is returned if encountered.
client.go:26
MethodPlayerDevices
PlayerDevices provides a mock function with given fields:
mocks/Client.go:42
MethodRunCallbackServer
RunCallbackServer creates a web server running on the port defined in the configuration file under the spotify. callback_url field. A pointer to the s
server.go:58
MethodRunCallbackServer
RunCallbackServer provides a mock function with given fields:
mocks/DiskplayerServer.go:32
MethodRunRecordServer
RunRecordServer creates a web server running on the port defined in the configuration file under the recorder. server_port field. Files are served dir
server.go:46
MethodRunRecordServer
RunRecordServer provides a mock function with given fields:
mocks/DiskplayerServer.go:55
FunctionTestConfigValue
(t *testing.T)
config_test.go:18
FunctionTestErrorHandler
(t *testing.T)
server_test.go:38
FunctionTestIndexHandler
(t *testing.T)
server_test.go:44
FunctionTestNewAuthenticator
(t *testing.T)
auth_test.go:17
FunctionTestNewAuthenticatorParseURLError
(t *testing.T)
auth_test.go:25
FunctionTestNewClient
(t *testing.T)
client_test.go:11
FunctionTestNewDiskplayerServer
(t *testing.T)
server_test.go:16
FunctionTestNewToken
(t *testing.T)
auth_test.go:31
FunctionTestNewTokenCallbackServerError
(t *testing.T)
auth_test.go:72
FunctionTestPauseDeviceNotFound
(t *testing.T)
diskplayer_test.go:283
FunctionTestPauseError
(t *testing.T)
diskplayer_test.go:319
FunctionTestPauseNoneActiveSuccess
(t *testing.T)
diskplayer_test.go:251
FunctionTestPausePlayerDevicesError
(t *testing.T)
diskplayer_test.go:306
FunctionTestPauseSuccess
(t *testing.T)
diskplayer_test.go:219
FunctionTestPlayPathEmptyFileError
(t *testing.T)
diskplayer_test.go:69
FunctionTestPlayPathInvalidPath
(t *testing.T)
diskplayer_test.go:61
FunctionTestPlayPathSuccess
(t *testing.T)
diskplayer_test.go:38
FunctionTestPlayUrPlayerDevicesError
(t *testing.T)
diskplayer_test.go:81
FunctionTestPlayUriDeviceNotFoundError
(t *testing.T)
diskplayer_test.go:94
FunctionTestPlayUriNoUriError
(t *testing.T)
diskplayer_test.go:75
FunctionTestPlayUriSuccess
(t *testing.T)
diskplayer_test.go:15
FunctionTestPlayUriTransferPlaybackPauseError
(t *testing.T)
diskplayer_test.go:151
FunctionTestPlayUriTransferPlaybackSuccess
(t *testing.T)
diskplayer_test.go:117
FunctionTestPlayUriTransferPlaybackTransferError
(t *testing.T)
diskplayer_test.go:184
FunctionTestReadConfigError
(t *testing.T)
config_test.go:8
FunctionTestReadToken
(t *testing.T)
auth_test.go:89
FunctionTestReadTokenFileError
(t *testing.T)
auth_test.go:100
FunctionTestRealDiskplayerServer_RunCallbackServer
(t *testing.T)
server_test.go:24
FunctionTestRecord
(t *testing.T)
recorder_test.go:23
FunctionTestRecordWriteError
(t *testing.T)
recorder_test.go:64
FunctionTestSaveToken
(t *testing.T)
auth_test.go:109
FunctionTestSaveTokenWriteError
(t *testing.T)
auth_test.go:133
MethodTokenChannel
()
server.go:74
MethodTokenChannel
TokenChannel provides a mock function with given fields:
mocks/DiskplayerServer.go:69
MethodTransferPlayback
TransferPlayback will transfer the Spotify playback to the specified device.
client.go:37
MethodTransferPlayback
TransferPlayback provides a mock function with given fields: deviceID, play
mocks/Client.go:65
FunctionindexHandler
indexHandler handles requests to the server for the root location "/". A listing of the attached devices is obtained and applied to the index.html tem
server.go:124
Functionmain
()
cmd/player/main.go:11
Functionmain
()
cmd/recorder/main.go:8
FunctionrecordHandler
recordHandler handles requests to the server which contain a Spotify web URL to be recorded. Two values are extracted from the request: web_url and de
server.go:88