images

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

package imagesrc defines interfaces for album and artist image providers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlbumImage

func GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error)

func GetArtistImage

func GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error)

func Initialize

func Initialize(opts ImageSourceOpts)

all functions are no-op if no providers are enabled

func Shutdown

func Shutdown()

Types

type AlbumImageOpts

type AlbumImageOpts struct {
	Artists           []string
	Album             string
	ReleaseMbzID      *uuid.UUID
	ReleaseGroupMbzID *uuid.UUID
}

type ArtistImageOpts

type ArtistImageOpts struct {
	Aliases []string
}

type DeezerAlbum

type DeezerAlbum struct {
	Title    string `json:"title"`
	CoverXL  string `json:"cover_xl"`
	CoverSm  string `json:"cover_small"`
	CoverMd  string `json:"cover_medium"`
	CoverBig string `json:"cover_big"`
}

type DeezerAlbumResponse

type DeezerAlbumResponse struct {
	Data []DeezerAlbum `json:"data"`
}

type DeezerArtist

type DeezerArtist struct {
	Name       string `json:"name"`
	PictureXL  string `json:"picture_xl"`
	PictureSm  string `json:"picture_small"`
	PictureMd  string `json:"picture_medium"`
	PictureBig string `json:"picture_big"`
}

type DeezerArtistResponse

type DeezerArtistResponse struct {
	Data []DeezerArtist `json:"data"`
}

type DeezerClient

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

func NewDeezerClient

func NewDeezerClient() *DeezerClient

func (*DeezerClient) GetAlbumImages

func (c *DeezerClient) GetAlbumImages(ctx context.Context, artists []string, album string) (string, error)

func (*DeezerClient) GetArtistImages

func (c *DeezerClient) GetArtistImages(ctx context.Context, aliases []string) (string, error)

func (*DeezerClient) Shutdown

func (c *DeezerClient) Shutdown()

type ErrorFinder

type ErrorFinder struct{}

func (*ErrorFinder) GetAlbumImage

func (m *ErrorFinder) GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error)

func (*ErrorFinder) GetArtistImage

func (m *ErrorFinder) GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error)

func (*ErrorFinder) Shutdown

func (m *ErrorFinder) Shutdown()

type ImageSource

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

type ImageSourceOpts

type ImageSourceOpts struct {
	UserAgent    string
	EnableCAA    bool
	EnableDeezer bool
}

type MockFinder

type MockFinder struct{}

func (*MockFinder) GetAlbumImage

func (m *MockFinder) GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error)

func (*MockFinder) GetArtistImage

func (m *MockFinder) GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error)

func (*MockFinder) Shutdown

func (m *MockFinder) Shutdown()

Jump to

Keyboard shortcuts

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