detailsclient

package
v0.0.0-...-a1990c1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 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 DetailsClient

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

func New

func New(settings Settings) *DetailsClient

New returns a new DetailsClient instance based on the provided settings. It configures the Resty client with the provided settings, sets the retry count and backoff time, and sets the base URL.

func (*DetailsClient) GetSongDetails

func (c *DetailsClient) GetSongDetails(
	ctx context.Context,
	title models.SongTitle,
) (models.SongDetail, error)

GetSongDetails retrieves the details of a song with the given title from the details server.

It logs debug messages before and after retrieving the details, and error messages if an error occurs.

Parameters:

  • ctx: The context for managing cancellation.
  • title: The models.SongTitle of the song whose details are to be retrieved.

Returns:

  • The models.SongDetail of the song if successful.
  • An error if the operation fails or if no details are found.

type Settings

type Settings struct {
	Addr string

	RetryCount      int
	RetryBackoff    time.Duration
	RetryMaxBackoff time.Duration
}

Jump to

Keyboard shortcuts

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