api

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

DO NOT EDIT THIS: This file was generated by the Pyrin Golang Generator

THIS FILE IS GENERATED BY PYRIN GOGEN CODE GENERATOR

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request[D any](data RequestData) (*D, error)

func RequestForm

func RequestForm[D any](data RequestData, boundary string, body Reader) (*D, error)

func Sprintf

func Sprintf(format string, a ...any) string

Simple wrapper for Sprintf

Types

type Album

type Album struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	CoverArt   Images `json:"coverArt"`
	ArtistId   string `json:"artistId"`
	ArtistName string `json:"artistName"`
	Year       *int   `json:"year,omitempty"`
	Created    int    `json:"created"`
	Updated    int    `json:"updated"`
}

type ApiError

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

func (*ApiError[E]) Error

func (err *ApiError[E]) Error() string

type ApiResponse

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

type Artist

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

type ChangePasswordBody

type ChangePasswordBody struct {
	CurrentPassword    string `json:"currentPassword"`
	NewPassword        string `json:"newPassword"`
	NewPasswordConfirm string `json:"newPasswordConfirm"`
}

type Client

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

func New

func New(addr string) *Client

func (*Client) AddItemsToPlaylist

func (c *Client) AddItemsToPlaylist(id string, body PostPlaylistItemsByIdBody, options Options) (*any, error)

func (*Client) ChangeAlbumCover

func (c *Client) ChangeAlbumCover(id string, body Reader, options Options) (*any, error)

func (*Client) ChangeArtistPicture

func (c *Client) ChangeArtistPicture(id string, body Reader, options Options) (*any, error)

func (*Client) ChangePassword

func (c *Client) ChangePassword(body ChangePasswordBody, options Options) (*any, error)

func (*Client) CreateAlbum

func (c *Client) CreateAlbum(body CreateAlbumBody, options Options) (*CreateAlbum, error)

func (*Client) CreatePlaylist

func (c *Client) CreatePlaylist(body PostPlaylistBody, options Options) (*PostPlaylist, error)

func (*Client) CreatePlaylistFromFilter

func (c *Client) CreatePlaylistFromFilter(body PostPlaylistFilterBody, options Options) (*PostPlaylist, error)

func (*Client) DeleteAlbum

func (c *Client) DeleteAlbum(id string, options Options) (*any, error)

func (*Client) DeletePlaylistItems

func (c *Client) DeletePlaylistItems(id string, body DeletePlaylistItemsByIdBody, options Options) (*any, error)

func (*Client) EditAlbum

func (c *Client) EditAlbum(id string, body PatchAlbumBody, options Options) (*any, error)

func (*Client) EditArtist

func (c *Client) EditArtist(id string, body EditArtistBody, options Options) (*any, error)

func (*Client) EditTrack

func (c *Client) EditTrack(id string, body PatchTrackBody, options Options) (*any, error)

func (*Client) GetAlbumById

func (c *Client) GetAlbumById(id string, options Options) (*GetAlbumById, error)

func (*Client) GetAlbumTracks

func (c *Client) GetAlbumTracks(id string, options Options) (*GetAlbumTracksById, error)

func (*Client) GetAlbums

func (c *Client) GetAlbums(options Options) (*GetAlbums, error)

func (*Client) GetArtistAlbums

func (c *Client) GetArtistAlbums(id string, options Options) (*GetArtistAlbumsById, error)

func (*Client) GetArtistById

func (c *Client) GetArtistById(id string, options Options) (*GetArtistById, error)

func (*Client) GetArtists

func (c *Client) GetArtists(options Options) (*GetArtists, error)

func (*Client) GetMe

func (c *Client) GetMe(options Options) (*GetAuthMe, error)

func (*Client) GetPlaylistById

func (c *Client) GetPlaylistById(id string, options Options) (*GetPlaylistById, error)

func (*Client) GetPlaylists

func (c *Client) GetPlaylists(options Options) (*GetPlaylists, error)

func (*Client) GetSystemInfo

func (c *Client) GetSystemInfo(options Options) (*GetSystemInfo, error)

func (*Client) GetTrackById

func (c *Client) GetTrackById(id string, options Options) (*GetTrackById, error)

func (*Client) GetTracks

func (c *Client) GetTracks(options Options) (*GetTracks, error)

func (*Client) MovePlaylistItem

func (c *Client) MovePlaylistItem(id string, body PostPlaylistsItemMoveByIdBody, options Options) (*any, error)

func (*Client) Process

func (c *Client) Process(options Options) (*any, error)

func (*Client) RemoveTrack

func (c *Client) RemoveTrack(id string, options Options) (*any, error)

func (*Client) SetToken

func (c *Client) SetToken(token string)

func (*Client) Signin

func (c *Client) Signin(body PostAuthSigninBody, options Options) (*PostAuthSignin, error)

func (*Client) Signup

func (c *Client) Signup(body PostAuthSignupBody, options Options) (*PostAuthSignup, error)

func (*Client) SystemExport

func (c *Client) SystemExport(options Options) (*Export, error)

func (*Client) UploadTracks

func (c *Client) UploadTracks(id string, body Reader, options Options) (*any, error)

type CreateAlbum

type CreateAlbum struct {
	AlbumId string `json:"albumId"`
}

type CreateAlbumBody

type CreateAlbumBody struct {
	Name   string `json:"name"`
	Artist string `json:"artist"`
}

type DeletePlaylistItemsByIdBody

type DeletePlaylistItemsByIdBody struct {
	TrackIds []string `json:"trackIds"`
}

type EditArtistBody

type EditArtistBody struct {
	Name *string `json:"name,omitempty"`
}

type Export

type Export struct {
	Artists []ExportArtist `json:"artists"`
	Albums  []ExportAlbum  `json:"albums"`
	Tracks  []ExportTrack  `json:"tracks"`
}

type ExportAlbum

type ExportAlbum struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	ArtistId string `json:"artistId"`
	CoverArt string `json:"coverArt"`
	Year     int    `json:"year"`
}

type ExportArtist

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

type ExportTrack

type ExportTrack struct {
	Id               string   `json:"id"`
	Name             string   `json:"name"`
	AlbumId          string   `json:"albumId"`
	ArtistId         string   `json:"artistId"`
	Number           int      `json:"number"`
	Duration         int      `json:"duration"`
	Year             int      `json:"year"`
	ExportName       string   `json:"exportName"`
	OriginalFilename string   `json:"originalFilename"`
	MobileFilename   string   `json:"mobileFilename"`
	Created          int      `json:"created"`
	Tags             []string `json:"tags"`
}

type GetAlbumById

type GetAlbumById Album

type GetAlbumTracksById

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

type GetAlbums

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

type GetArtistAlbumsById

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

type GetArtistById

type GetArtistById Artist

type GetArtists

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

type GetAuthMe

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

type GetPlaylistById

type GetPlaylistById struct {
	Id    string  `json:"id"`
	Name  string  `json:"name"`
	Items []Track `json:"items"`
}

type GetPlaylists

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

type GetSystemInfo

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

type GetTrackById

type GetTrackById Track

type GetTracks

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

type Images

type Images struct {
	Original string `json:"original"`
	Small    string `json:"small"`
	Medium   string `json:"medium"`
	Large    string `json:"large"`
}

type Options

type Options struct {
	QueryParams map[string]string
	Boundary    string
}

type PatchAlbumBody

type PatchAlbumBody struct {
	Name       *string `json:"name,omitempty"`
	ArtistId   *string `json:"artistId,omitempty"`
	ArtistName *string `json:"artistName,omitempty"`
	Year       *int    `json:"year,omitempty"`
}

type PatchTrackBody

type PatchTrackBody struct {
	Name       *string   `json:"name,omitempty"`
	ArtistId   *string   `json:"artistId,omitempty"`
	ArtistName *string   `json:"artistName,omitempty"`
	Year       *int      `json:"year,omitempty"`
	Number     *int      `json:"number,omitempty"`
	Tags       *[]string `json:"tags,omitempty"`
}

type Playlist

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

type PostAuthSignin

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

type PostAuthSigninBody

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

type PostAuthSignup

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

type PostAuthSignupBody

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

type PostPlaylist

type PostPlaylist Playlist

type PostPlaylistBody

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

type PostPlaylistFilterBody

type PostPlaylistFilterBody struct {
	Name   string `json:"name"`
	Filter string `json:"filter"`
	Sort   string `json:"sort"`
}

type PostPlaylistItemsByIdBody

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

type PostPlaylistsItemMoveByIdBody

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

type Reader

type Reader interface {
	Read(p []byte) (n int, err error)
}

Copy of io.Reader interface

type RequestData

type RequestData struct {
	Url    string
	Method string

	Token string
	Body  any
}

type Track

type Track struct {
	Id               string   `json:"id"`
	Name             string   `json:"name"`
	AlbumId          string   `json:"albumId"`
	ArtistId         string   `json:"artistId"`
	Number           *int     `json:"number,omitempty"`
	Duration         *int     `json:"duration,omitempty"`
	Year             *int     `json:"year,omitempty"`
	OriginalMediaUrl string   `json:"originalMediaUrl"`
	MobileMediaUrl   string   `json:"mobileMediaUrl"`
	CoverArt         Images   `json:"coverArt"`
	AlbumName        string   `json:"albumName"`
	ArtistName       string   `json:"artistName"`
	Created          int      `json:"created"`
	Updated          int      `json:"updated"`
	Tags             []string `json:"tags"`
}

type UploadTracksBody

type UploadTracksBody struct {
	ForceExtractNumber bool `json:"forceExtractNumber"`
}

Jump to

Keyboard shortcuts

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