api

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package api provides the HTTP client for the SomaFM API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SomaFMClient

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

SomaFMClient is the HTTP client for interacting with the SomaFM API.

func NewSomaFMClient

func NewSomaFMClient() *SomaFMClient

NewSomaFMClient creates a new SomaFM API client with sensible defaults.

func (*SomaFMClient) GetCurrentTrackForStation

func (c *SomaFMClient) GetCurrentTrackForStation(stationID string) (string, error)

func (*SomaFMClient) GetRecentSongs

func (c *SomaFMClient) GetRecentSongs(stationID string) (*SongsResponse, error)

GetRecentSongs fetches the recent song history for a specific station.

func (*SomaFMClient) GetStations

func (c *SomaFMClient) GetStations() ([]station.Station, error)

GetStations fetches the list of available radio stations from the SomaFM API.

type SongInfo

type SongInfo struct {
	Title  string `json:"title"`
	Artist string `json:"artist"`
	Album  string `json:"album"`
	Date   string `json:"date"`
}

type SongsResponse

type SongsResponse struct {
	ID    string     `json:"id"`
	Songs []SongInfo `json:"songs"`
}

Jump to

Keyboard shortcuts

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