types

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StatusSuccess = "success"
	StatusError   = "error"
)

Variables

View Source
var (
	ErrNoArtist = NewApiError(http.StatusNotFound, "Artist not found")
	ErrNoAlbum  = NewApiError(http.StatusNotFound, "Album not found")
	ErrNoTrack  = NewApiError(http.StatusNotFound, "Track not found")
)

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Errors  any    `json:"errors,omitempty"`
}

func NewApiError

func NewApiError(code int, message string, errors ...any) *ApiError

func (*ApiError) Error

func (err *ApiError) Error() string

type ApiResponse

type ApiResponse struct {
	Status string    `json:"status"`
	Data   any       `json:"data,omitempty"`
	Error  *ApiError `json:"error,omitempty"`
}

func NewApiSuccessResponse added in v0.6.0

func NewApiSuccessResponse(data any) ApiResponse

type Change added in v0.7.0

type Change[T any] struct {
	Value   T
	Changed bool
}

type GetAlbumById added in v0.6.0

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

type GetAlbumTracksById added in v0.6.0

type GetAlbumTracksById struct {
	Tracks []GetAlbumTracksByIdItem `json:"tracks"`
}

type GetAlbumTracksByIdItem added in v0.6.0

type GetAlbumTracksByIdItem struct {
	Id                string `json:"id"`
	Number            int    `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 GetAlbums added in v0.6.0

type GetAlbums struct {
	Albums []GetAlbumsItem `json:"albums"`
}

type GetAlbumsItem added in v0.6.0

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

type GetArtistAlbumsById added in v0.6.0

type GetArtistAlbumsById struct {
	Albums []GetArtistAlbumsByIdItem `json:"albums"`
}

type GetArtistAlbumsByIdItem added in v0.6.0

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

type GetArtistById added in v0.6.0

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

type GetArtists added in v0.6.0

type GetArtists struct {
	Artists []GetArtistsItem `json:"artists"`
}

type GetArtistsItem added in v0.6.0

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

type GetSync added in v0.6.0

type GetSync struct {
	IsSyncing bool `json:"isSyncing"`
}

type GetTrackById added in v0.6.0

type GetTrackById struct {
	Id                string `json:"id"`
	Number            int    `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 GetTracks added in v0.6.0

type GetTracks struct {
	Tracks []GetTracksItem `json:"tracks"`
}

type GetTracksItem added in v0.6.0

type GetTracksItem struct {
	Id                string `json:"id"`
	Number            int    `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"`
	AlbumName         string `json:"albumName"`
	ArtistName        string `json:"artistName"`
}

type Map

type Map map[string]any

type WorkDir added in v0.3.0

type WorkDir string

func (WorkDir) ImagesDir added in v0.3.0

func (d WorkDir) ImagesDir() string

func (WorkDir) MobileTracksDir added in v0.3.0

func (d WorkDir) MobileTracksDir() string

func (WorkDir) OriginalTracksDir added in v0.3.0

func (d WorkDir) OriginalTracksDir() string

func (WorkDir) String added in v0.3.0

func (d WorkDir) String() string

func (WorkDir) TranscodeDir added in v0.3.0

func (d WorkDir) TranscodeDir() string

Jump to

Keyboard shortcuts

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