types

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiAlbum

type ApiAlbum struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	CoverArt string `json:"coverArt"`
	ArtistId string `json:"artistId"`
}

type ApiArtist

type ApiArtist struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Picture string `json:"picture"`
}

type ApiError

type ApiError struct {
	Status  int    `json:"status" example:"400"`
	Message string `json:"message"`
	Data    any    `json:"data,omitempty"`
}

func ApiBadRequestError

func ApiBadRequestError(message string, data ...any) ApiError

func ApiNotFoundError

func ApiNotFoundError(message string, data ...any) ApiError

func NewApiError

func NewApiError(status int, message string, data ...any) ApiError

func (ApiError) Error

func (err ApiError) Error() string

type ApiGetAlbumByIdData added in v0.2.0

type ApiGetAlbumByIdData ApiAlbum

type ApiGetAlbumTracksByIdData added in v0.2.0

type ApiGetAlbumTracksByIdData struct {
	Tracks []ApiTrack `json:"tracks"`
}

type ApiGetAlbumsData added in v0.2.0

type ApiGetAlbumsData struct {
	Albums []ApiAlbum `json:"albums"`
}

type ApiGetArtistAlbumsByIdData added in v0.2.0

type ApiGetArtistAlbumsByIdData struct {
	Albums []ApiAlbum `json:"albums"`
}

type ApiGetArtistByIdData added in v0.2.0

type ApiGetArtistByIdData ApiArtist

type ApiGetArtistsData added in v0.2.0

type ApiGetArtistsData struct {
	Artists []ApiArtist `json:"artists"`
}

type ApiGetTrackByIdData added in v0.2.0

type ApiGetTrackByIdData ApiTrack

type ApiGetTracksData added in v0.2.0

type ApiGetTracksData struct {
	Tracks []ApiGetTracksDataTrackItem `json:"tracks"`
}

type ApiGetTracksDataTrackItem added in v0.2.0

type ApiGetTracksDataTrackItem struct {
	ApiTrack
	AlbumName  string `json:"albumName"`
	ArtistName string `json:"artistName"`
}

NOTE(patrik): Album Handlers TODO(patrik): Use these in the track handlers

type ApiPostAlbumData added in v0.2.0

type ApiPostAlbumData ApiAlbum

type ApiPostArtistData added in v0.2.0

type ApiPostArtistData ApiArtist

type ApiPostTrackData added in v0.2.0

type ApiPostTrackData ApiTrack

type ApiResponse

type ApiResponse[T any] struct {
	Status int `json:"status" example:"200"`
	Data   T   `json:"data"`
}

func NewApiResponse

func NewApiResponse[T any](data T) ApiResponse[T]

type ApiTrack

type ApiTrack struct {
	Id                string `json:"id"`
	Number            int32  `json:"number"`
	Name              string `json:"name"`
	CoverArt          string `json:"coverArt"`
	BestQualityFile   string `json:"bestQualityFile"`
	MobileQualityFile string `json:"mobileQualityFile"`
	AlbumId           string `json:"albumId"`
	ArtistId          string `json:"artistId"`
}

type Map

type Map map[string]any

Jump to

Keyboard shortcuts

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