Documentation ¶
Index ¶
- Variables
- func Execute(ctx context.Context, cfg config.Config) error
- func NewHTTPServer(m *Manager) (*grpc.Server, error)
- type IcecastStatus
- type Listener
- type Manager
- func (m *Manager) CurrentListeners(ctx context.Context) (eventstream.Stream[radio.Listeners], error)
- func (m *Manager) CurrentSong(ctx context.Context) (eventstream.Stream[*radio.SongUpdate], error)
- func (m *Manager) CurrentStatus(ctx context.Context) (eventstream.Stream[radio.Status], error)
- func (m *Manager) CurrentThread(ctx context.Context) (eventstream.Stream[radio.Thread], error)
- func (m *Manager) CurrentUser(ctx context.Context) (eventstream.Stream[*radio.User], error)
- func (m *Manager) Status(ctx context.Context) (*radio.Status, error)
- func (m *Manager) UpdateListeners(ctx context.Context, listeners radio.Listeners) error
- func (m *Manager) UpdateSong(ctx context.Context, update *radio.SongUpdate) error
- func (m *Manager) UpdateThread(ctx context.Context, thread radio.Thread) error
- func (m *Manager) UpdateUser(ctx context.Context, u *radio.User) error
- type RelayInfo
- type RelayStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ExecuteListener = NewListener
ExecuteListener is an alias for NewListener
Functions ¶
Types ¶
type IcecastStatus ¶
type IcecastStatus struct { Icestats struct { Admin string `json:"admin"` Host string `json:"host"` Location string `json:"location"` ServerID string `json:"server_id"` ServerStart string `json:"server_start"` ServerStartIso8601 string `json:"server_start_iso8601"` Source []struct { AudioInfo string `json:"audio_info,omitempty"` Bitrate int `json:"bitrate,omitempty"` Channels int `json:"channels,omitempty"` Genre string `json:"genre"` ListenerPeak int `json:"listener_peak"` Listeners int `json:"listeners"` Listenurl string `json:"listenurl"` Samplerate int `json:"samplerate,omitempty"` ServerDescription string `json:"server_description"` ServerName string `json:"server_name"` ServerType string `json:"server_type"` ServerURL string `json:"server_url,omitempty"` StreamStart string `json:"stream_start"` StreamStartIso8601 string `json:"stream_start_iso8601"` Title string `json:"title"` } `json:"source"` } `json:"icestats"` }
func FetchIcecastStatus ¶
func FetchIcecastStatus(ctx context.Context, uri string) (IcecastStatus, error)
FetchIcecastStatus fetches the status page of an icecast server. This requires an icecast server version equal to or higher than 2.4
type Listener ¶
Listener listens to an icecast mp3 stream with interleaved song metadata
func NewListener ¶
NewListener creates a listener and starts running in the background immediately
type Manager ¶
type Manager struct { config.Config Storage radio.StorageService // contains filtered or unexported fields }
Manager manages shared state between different processes
func NewManager ¶
NewManager returns a manager ready for use
func (*Manager) CurrentListeners ¶
func (*Manager) CurrentSong ¶
func (m *Manager) CurrentSong(ctx context.Context) (eventstream.Stream[*radio.SongUpdate], error)
func (*Manager) CurrentStatus ¶
func (*Manager) CurrentThread ¶
func (*Manager) CurrentUser ¶
func (*Manager) UpdateListeners ¶
UpdateListeners sets the listener count
func (*Manager) UpdateSong ¶
UpdateSong sets information about the currently playing song
func (*Manager) UpdateThread ¶
UpdateThread sets the current thread information on the front page and chats
type RelayInfo ¶
type RelayInfo struct { Online *bool `json:"online"` Primary bool `json:"primary"` Disabled bool `json:"disabled"` Noredir bool `json:"noredir"` Listeners int `json:"listeners"` Max int `json:"max"` Priority int `json:"priority"` Links struct { Status string `json:"status"` Stream string `json:"stream"` } `json:"links"` }
type RelayStatus ¶
type RelayStatus struct { Relays map[string]RelayInfo `json:"relays"` Listeners int `json:"listeners"` StreamURL string `json:"stream_url"` }
func FetchRelayStatus ¶
func FetchRelayStatus(ctx context.Context, uri string) (RelayStatus, error)
FetchRelayStatus fetches the status page of the load balancer
Click to show internal directories.
Click to hide internal directories.