bridge

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package bridge defines the stable JSON wire types shared by the native bindings. Keep field order and JSON tags stable: native clients depend on this exact shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Artists    []Artist `json:"artists"`
	ArtworkURL string   `json:"artworkUrl"`
}

Album is an album on the native JSON wire.

func FromAlbum

func FromAlbum(album deezer.Album) Album

FromAlbum converts a Deezer album to its native wire representation.

func FromAlbums

func FromAlbums(albums []deezer.Album) []Album

FromAlbums converts Deezer albums to their native wire representation.

type Artist

type Artist struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Artist is a track or album credit on the native JSON wire.

func FromArtist

func FromArtist(a deezer.Artist) Artist

FromArtist converts a Deezer artist to its native wire representation.

func FromArtists

func FromArtists(artists []deezer.Artist) []Artist

FromArtists converts Deezer artists to their native wire representation. It deliberately returns a non-nil empty slice for nil input so JSON remains [] rather than null, matching the original binding implementations.

type ArtistInfo

type ArtistInfo struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	ArtworkURL string `json:"artworkUrl"`
	NbFans     int    `json:"nbFans"`
}

ArtistInfo is an artist search result or profile on the native JSON wire.

func FromArtistInfo

func FromArtistInfo(artist deezer.ArtistInfo) ArtistInfo

FromArtistInfo converts Deezer artist information to its native wire representation.

func FromArtistInfos

func FromArtistInfos(artists []deezer.ArtistInfo) []ArtistInfo

FromArtistInfos converts Deezer artist information to its native wire representation.

type Episode

type Episode struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	ArtworkURL  string `json:"artworkUrl"`
	DurationMS  int64  `json:"durationMs"`
	ReleaseDate string `json:"releaseDate"`
	PodcastName string `json:"podcastName"`
}

Episode is a podcast episode on the native JSON wire.

func FromEpisode

func FromEpisode(episode deezer.Episode) Episode

FromEpisode converts a Deezer podcast episode to its native wire representation.

func FromEpisodes

func FromEpisodes(episodes []deezer.Episode) []Episode

FromEpisodes converts Deezer podcast episodes to their native wire representation.

type Playlist

type Playlist struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Owner      string `json:"owner"`
	TrackCount int    `json:"trackCount"`
	ArtworkURL string `json:"artworkUrl"`
}

Playlist is a playlist on the native JSON wire.

func FromPlaylist

func FromPlaylist(playlist deezer.Playlist) Playlist

FromPlaylist converts a Deezer playlist to its native wire representation.

func FromPlaylists

func FromPlaylists(playlists []deezer.Playlist) []Playlist

FromPlaylists converts Deezer playlists to their native wire representation.

type Podcast

type Podcast struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Description  string `json:"description"`
	ArtworkURL   string `json:"artworkUrl"`
	EpisodeCount int    `json:"episodeCount"`
}

Podcast is a podcast on the native JSON wire.

func FromPodcast

func FromPodcast(podcast deezer.Podcast) Podcast

FromPodcast converts a Deezer podcast to its native wire representation.

func FromPodcasts

func FromPodcasts(podcasts []deezer.Podcast) []Podcast

FromPodcasts converts Deezer podcasts to their native wire representation.

type Track

type Track struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	DurationMS int64    `json:"durationMs"`
	Artists    []Artist `json:"artists"`
	ArtistLine string   `json:"artistLine"`
	ArtistID   string   `json:"artistId,omitempty"`
	AlbumName  string   `json:"albumName"`
	ArtworkURL string   `json:"artworkUrl"`
	Explicit   bool     `json:"explicit"`
}

Track is a track on the native JSON wire.

func FromTrack

func FromTrack(track deezer.Track) Track

FromTrack converts a Deezer track to its native wire representation.

func FromTracks

func FromTracks(tracks []deezer.Track) []Track

FromTracks converts Deezer tracks to their native wire representation.

Jump to

Keyboard shortcuts

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