Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MusicInfoAPI ¶
type MusicInfoAPI struct {
// contains filtered or unexported fields
}
MusicInfoAPI is an API client used to fetch song information from an external music service.
func NewMusicInfoAPI ¶
func NewMusicInfoAPI(baseURL string, client *http.Client) *MusicInfoAPI
NewMusicInfoAPI creates a new instance of MusicInfoAPI with the provided base URL and HTTP client. If no client is provided, the default HTTP client is used. It also registers custom validations.
func (*MusicInfoAPI) FetchSongInfo ¶
func (api *MusicInfoAPI) FetchSongInfo(ctx context.Context, song entity.Song) (*entity.SongDetail, error)
FetchSongInfo retrieves song details from the external API by performing an HTTP GET request. The song's group name and title are passed as query parameters. It returns a SongDetail entity or an error.
Click to show internal directories.
Click to hide internal directories.