api

package
v0.0.0-...-6e7fa2b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

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