Documentation
¶
Overview ¶
Package service provides the business logic layer for managing station data.
Index ¶
- type StationService
- func (s *StationService) FindIndexByID(stationID string) int
- func (s *StationService) GetCachedStations() []station.Station
- func (s *StationService) GetCurrentTrackForStation(stationID string) (string, error)
- func (s *StationService) GetStation(index int) *station.Station
- func (s *StationService) GetStations() ([]station.Station, error)
- func (s *StationService) GetValidStationIDs() map[string]bool
- func (s *StationService) LoadImage(url string) (image.Image, error)
- func (s *StationService) StartPeriodicRefresh(interval time.Duration, callback func([]station.Station))
- func (s *StationService) StationCount() int
- func (s *StationService) StopPeriodicRefresh()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StationService ¶
type StationService struct {
// contains filtered or unexported fields
}
StationService manages station data, including fetching, caching, and periodic refresh.
func NewStationService ¶
func NewStationService(apiClient *api.SomaFMClient) *StationService
NewStationService creates a new StationService with the given API client.
func (*StationService) FindIndexByID ¶
func (s *StationService) FindIndexByID(stationID string) int
func (*StationService) GetCachedStations ¶
func (s *StationService) GetCachedStations() []station.Station
func (*StationService) GetCurrentTrackForStation ¶
func (s *StationService) GetCurrentTrackForStation(stationID string) (string, error)
func (*StationService) GetStation ¶
func (s *StationService) GetStation(index int) *station.Station
GetStation returns a copy of the station at the given index. Returns nil if the index is out of bounds. The returned station is a copy to prevent invalidation when the internal slice is refreshed.
func (*StationService) GetStations ¶
func (s *StationService) GetStations() ([]station.Station, error)
func (*StationService) GetValidStationIDs ¶
func (s *StationService) GetValidStationIDs() map[string]bool
func (*StationService) LoadImage ¶
func (s *StationService) LoadImage(url string) (image.Image, error)
func (*StationService) StartPeriodicRefresh ¶
func (s *StationService) StartPeriodicRefresh(interval time.Duration, callback func([]station.Station))
func (*StationService) StationCount ¶
func (s *StationService) StationCount() int
func (*StationService) StopPeriodicRefresh ¶
func (s *StationService) StopPeriodicRefresh()
Click to show internal directories.
Click to hide internal directories.