types

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

THIS FILE IS GENERATED BY PYRIN GOGEN CODE GENERATOR

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")
	ErrNoPlaylist = NewApiError(http.StatusNotFound, "Playlist not found")

	ErrInvalidAuthHeader = NewApiError(http.StatusUnauthorized, "Invalid Auth Header")
	ErrInvalidToken      = NewApiError(http.StatusUnauthorized, "Invalid Token")
	ErrIncorrectCreds    = NewApiError(http.StatusUnauthorized, "Incorrect credentials")

	ErrEmptyBody = NewApiError(http.StatusBadRequest, "Expected body not to be empty")
)
View Source
var DeletePlaylistItemsByIdBodySchema = jio.Object().Keys(jio.K{
	"trackIndices": jio.Array().Items(jio.Number().Integer()).Min(1).Required(),
})
View Source
var PostAuthSigninBodySchema = jio.Object().Keys(jio.K{
	"username": jio.String().Required(),
	"password": jio.String().Required(),
})
View Source
var PostAuthSignupBodySchema = jio.Object().Keys(jio.K{
	"username":        jio.String().Min(4).Required(),
	"password":        jio.String().Min(8).Required(),
	"passwordConfirm": jio.String().Min(8).Required(),
})
View Source
var PostPlaylistBodySchema = jio.Object().Keys(jio.K{
	"name": jio.String().Required(),
})
View Source
var PostPlaylistItemsByIdBodySchema = jio.Object().Keys(jio.K{
	"tracks": jio.Array().Items(jio.String()).Min(1).Required(),
})
View Source
var PostPlaylistsItemMoveByIdBodySchema = jio.Object().Keys(jio.K{
	"trackId": jio.String().Required(),
	"toIndex": jio.Number().Integer().Required(),
})
View Source
var PostSystemSetupBodySchema = jio.Object().Keys(jio.K{
	"username":        jio.String().Required(),
	"password":        jio.String().Required(),
	"passwordConfirm": jio.String().Required(),
})

Functions

This section is empty.

Types

type Album added in v0.9.0

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

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 Artist added in v0.9.0

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

type Change added in v0.7.0

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

type DeletePlaylistItemsByIdBody added in v0.10.0

type DeletePlaylistItemsByIdBody struct {
	TrackIndices []int `json:"trackIndices"`
}

type GetAlbumById added in v0.6.0

type GetAlbumById struct {
	Album
}

type GetAlbumTracksById added in v0.6.0

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

type GetAlbums added in v0.6.0

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

type GetArtistAlbumsById added in v0.6.0

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

type GetArtistById added in v0.6.0

type GetArtistById struct {
	Artist
}

type GetArtists added in v0.6.0

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

type GetAuthMe added in v0.10.0

type GetAuthMe struct {
	Id       string `json:"id"`
	Username string `json:"username"`
}

type GetPlaylistById added in v0.10.0

type GetPlaylistById struct {
	Playlist

	Items []Track `json:"items"`
}

type GetPlaylists added in v0.10.0

type GetPlaylists struct {
	Playlists []Playlist `json:"playlists"`
}

type GetSync added in v0.6.0

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

type GetSystemInfo added in v0.10.0

type GetSystemInfo struct {
	Version string `json:"version"`
	IsSetup bool   `json:"isSetup"`
}

type GetTags added in v0.9.0

type GetTags struct {
	Tags []Tag `json:"tags"`
}

type GetTrackById added in v0.6.0

type GetTrackById struct {
	Track
}

type GetTracks added in v0.6.0

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

type Map

type Map map[string]any

type Playlist added in v0.10.0

type Playlist struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type PostAuthSignin added in v0.10.0

type PostAuthSignin struct {
	Token string `json:"token"`
}

type PostAuthSigninBody added in v0.10.0

type PostAuthSigninBody struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type PostAuthSignup added in v0.10.0

type PostAuthSignup struct {
	Id       string `json:"id"`
	Username string `json:"username"`
}

type PostAuthSignupBody added in v0.10.0

type PostAuthSignupBody struct {
	Username        string `json:"username"`
	Password        string `json:"password"`
	PasswordConfirm string `json:"passwordConfirm"`
}

type PostPlaylist added in v0.10.0

type PostPlaylist struct {
	Playlist
}

type PostPlaylistBody added in v0.10.0

type PostPlaylistBody struct {
	Name string `json:"name"`
}

type PostPlaylistItemsByIdBody added in v0.10.0

type PostPlaylistItemsByIdBody struct {
	Tracks []string `json:"tracks"`
}

type PostPlaylistsItemMoveByIdBody added in v0.10.0

type PostPlaylistsItemMoveByIdBody struct {
	TrackId string `json:"trackId"`
	ToIndex int    `json:"toIndex"`
}

type PostQueue added in v0.9.0

type PostQueue struct {
	Tracks []Track `json:"tracks"`
}

type PostSystemSetupBody added in v0.10.0

type PostSystemSetupBody struct {
	Username        string `json:"username"`
	Password        string `json:"password"`
	PasswordConfirm string `json:"passwordConfirm"`
}

type Tag added in v0.9.0

type Tag struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Track added in v0.9.0

type Track struct {
	Id                string `json:"id"`
	Number            int    `json:"number"`
	Name              string `json:"name"`
	CoverArt          string `json:"coverArt"`
	Duration          int    `json:"duration"`
	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 WorkDir added in v0.3.0

type WorkDir string

func (WorkDir) DatabaseFile added in v0.10.0

func (d WorkDir) DatabaseFile() 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