Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventSongStart = "songstart" EventSongFinish = "songfinish" EventSongLove = "songlove" EventSongBan = "songban" HandleSongStart EventFlags = 1 << iota HandleSongFinish HandleSongLove HandleSongBan )
Variables ¶
This section is empty.
Functions ¶
func Handle ¶
func Handle( ctx context.Context, event string, handle EventFlags, stdin io.Reader, w wal.WAL[pianobar.Track], s lastfm.Scrobbler, f lastfm.FeedbackProvider, ) (io.Reader, error)
Handle processes a command executed by pianobar's eventcmd interface. First, it checks to see if the provided event is handled based on the set EventFlags. If not, it returns the passed reader and no error.
If the event is enabled, the stdin reader is read fully and the event is handled. Then, a new reader is returned as well as any error from the handling of the event.
In either case, if event chaining is enabled, the returned reader can be used to re-read the eventcmd payload.
Types ¶
type EventFlags ¶
type EventFlags uint8
func (EventFlags) ShouldHandle ¶
func (e EventFlags) ShouldHandle(event string) bool
ShouldHandle returns true iff the correct flag is set for the specified event
Click to show internal directories.
Click to hide internal directories.