api

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 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 AddItemToPlaylistBody added in v0.18.0

type AddItemToPlaylistBody struct {
	TrackId string `json:"trackId"`
}

type Album

type Album struct {
	Id               string       `json:"id"`
	Name             Name         `json:"name"`
	Year             *int         `json:"year,omitempty"`
	CoverArt         Images       `json:"coverArt"`
	ArtistId         string       `json:"artistId"`
	ArtistName       Name         `json:"artistName"`
	Tags             []string     `json:"tags"`
	FeaturingArtists []ArtistInfo `json:"featuringArtists"`
	AllArtists       []ArtistInfo `json:"allArtists"`
	Created          int          `json:"created"`
	Updated          int          `json:"updated"`
}

type ApiError

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

func (*ApiError[E]) Error

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

type ApiResponse

type ApiResponse[D any, E any] struct {
	Success bool         `json:"success"`
	Data    D            `json:"data,omitempty"`
	Error   *ApiError[E] `json:"error,omitempty"`
}

type ApiToken added in v0.18.0

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

type Artist

type Artist struct {
	Id      string   `json:"id"`
	Name    Name     `json:"name"`
	Picture Images   `json:"picture"`
	Tags    []string `json:"tags"`
	Created int      `json:"created"`
	Updated int      `json:"updated"`
}

type ArtistInfo added in v0.18.0

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

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) AddItemToPlaylist added in v0.18.0

func (c *Client) AddItemToPlaylist(id string, body AddItemToPlaylistBody, options Options) (*any, error)

func (*Client) AddToUserQuickPlaylist added in v0.18.0

func (c *Client) AddToUserQuickPlaylist(body TrackId, 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) CreateApiToken added in v0.18.0

func (c *Client) CreateApiToken(body CreateApiTokenBody, options Options) (*CreateApiToken, error)

func (*Client) CreateArtist added in v0.18.0

func (c *Client) CreateArtist(body CreateArtistBody, options Options) (*CreateArtist, error)

func (*Client) CreatePlaylist

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

func (*Client) CreatePlaylistFromFilter

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

func (*Client) CreateTaglist added in v0.18.0

func (c *Client) CreateTaglist(body CreateTaglistBody, options Options) (*CreateTaglist, error)

func (*Client) DeleteAlbum

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

func (*Client) DeleteTaglist added in v0.18.0

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

func (*Client) DeleteTrack added in v0.18.0

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

func (*Client) EditAlbum

func (c *Client) EditAlbum(id string, body EditAlbumBody, 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 EditTrackBody, 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) (*GetAlbumTracks, error)

func (*Client) GetAlbums

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

func (*Client) GetAllApiTokens added in v0.18.0

func (c *Client) GetAllApiTokens(options Options) (*GetAllApiTokens, 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) (*GetMe, 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) GetTaglistById added in v0.18.0

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

func (*Client) GetTaglistTracks added in v0.18.0

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

func (*Client) GetTaglists added in v0.18.0

func (c *Client) GetTaglists(options Options) (*GetTaglists, 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) GetUserQuickPlaylistItemIds added in v0.18.0

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

func (*Client) Process

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

func (*Client) RefillSearch added in v0.18.0

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

func (*Client) RemoveApiToken added in v0.18.0

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

func (*Client) RemoveItemFromUserQuickPlaylist added in v0.18.0

func (c *Client) RemoveItemFromUserQuickPlaylist(body TrackId, options Options) (*any, error)

func (*Client) RemovePlaylistItem added in v0.18.0

func (c *Client) RemovePlaylistItem(id string, body RemovePlaylistItemBody, options Options) (*any, error)

func (*Client) RemoveTrack

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

func (*Client) SearchAlbums added in v0.18.0

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

func (*Client) SearchArtists added in v0.18.0

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

func (*Client) SearchTracks added in v0.18.0

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

func (*Client) SetToken

func (c *Client) SetToken(token string)

func (*Client) Signin

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

func (*Client) Signup

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

func (*Client) SystemExport

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

func (*Client) UpdateTaglist added in v0.18.0

func (c *Client) UpdateTaglist(id string, body UpdateTaglistBody, options Options) (*any, error)

func (*Client) UpdateUserSettings added in v0.18.0

func (c *Client) UpdateUserSettings(body UpdateUserSettingsBody, options Options) (*any, error)

func (*Client) UploadTrack added in v0.18.0

func (c *Client) UploadTrack(body Reader, options Options) (*any, error)

type CreateAlbum

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

type CreateAlbumBody

type CreateAlbumBody struct {
	Name             string   `json:"name"`
	OtherName        string   `json:"otherName"`
	ArtistId         string   `json:"artistId"`
	Year             int      `json:"year"`
	Tags             []string `json:"tags"`
	FeaturingArtists []string `json:"featuringArtists"`
}

type CreateApiToken added in v0.18.0

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

type CreateApiTokenBody added in v0.18.0

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

type CreateArtist added in v0.18.0

type CreateArtist struct {
	Id string `json:"id"`
}

type CreateArtistBody added in v0.18.0

type CreateArtistBody struct {
	Name      string `json:"name"`
	OtherName string `json:"otherName"`
}

type CreatePlaylist added in v0.18.0

type CreatePlaylist Playlist

type CreatePlaylistBody added in v0.18.0

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

type CreateTaglist added in v0.18.0

type CreateTaglist struct {
	Id string `json:"id"`
}

type CreateTaglistBody added in v0.18.0

type CreateTaglistBody struct {
	Name   string `json:"name"`
	Filter string `json:"filter"`
}

type EditAlbumBody added in v0.18.0

type EditAlbumBody struct {
	Name             *string   `json:"name,omitempty"`
	OtherName        *string   `json:"otherName,omitempty"`
	ArtistId         *string   `json:"artistId,omitempty"`
	ArtistName       *string   `json:"artistName,omitempty"`
	Year             *int      `json:"year,omitempty"`
	Tags             *[]string `json:"tags,omitempty"`
	FeaturingArtists *[]string `json:"featuringArtists,omitempty"`
}

type EditArtistBody

type EditArtistBody struct {
	Name *string   `json:"name,omitempty"`
	Tags *[]string `json:"tags,omitempty"`
}

type EditTrackBody added in v0.18.0

type EditTrackBody struct {
	Name             *string   `json:"name,omitempty"`
	OtherName        *string   `json:"otherName,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"`
	FeaturingArtists *[]string `json:"featuringArtists,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"`
	Duration         int      `json:"duration"`
	Number           int      `json:"number"`
	Year             int      `json:"year"`
	OriginalFilename string   `json:"originalFilename"`
	MobileFilename   string   `json:"mobileFilename"`
	Created          int      `json:"created"`
	Tags             []string `json:"tags"`
}

type GetAlbumById

type GetAlbumById Album

type GetAlbumTracks added in v0.18.0

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

type GetAlbums

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

type GetAllApiTokens added in v0.18.0

type GetAllApiTokens struct {
	Tokens []ApiToken `json:"tokens"`
}

type GetArtistAlbumsById

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

type GetArtistById

type GetArtistById Artist

type GetArtists

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

type GetMe added in v0.18.0

type GetMe struct {
	Id            string  `json:"id"`
	Username      string  `json:"username"`
	Role          string  `json:"role"`
	DisplayName   string  `json:"displayName"`
	QuickPlaylist *string `json:"quickPlaylist,omitempty"`
}

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 GetTaglistById added in v0.18.0

type GetTaglistById Taglist

type GetTaglistTracks added in v0.18.0

type GetTaglistTracks struct {
	Page   Page    `json:"page"`
	Tracks []Track `json:"tracks"`
}

type GetTaglists added in v0.18.0

type GetTaglists struct {
	Taglists []Taglist `json:"taglists"`
}

type GetTrackById

type GetTrackById Track

type GetTracks

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

type GetUserQuickPlaylistItemIds added in v0.18.0

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

type Images

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

type Name added in v0.18.0

type Name struct {
	Default string  `json:"default"`
	Other   *string `json:"other,omitempty"`
}

type Options

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

type Page added in v0.18.0

type Page struct {
	Page       int `json:"page"`
	PerPage    int `json:"perPage"`
	TotalItems int `json:"totalItems"`
	TotalPages int `json:"totalPages"`
}

type Playlist

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

type PostPlaylistFilterBody

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

type Reader

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

Copy of io.Reader interface

type RemovePlaylistItemBody added in v0.18.0

type RemovePlaylistItemBody struct {
	TrackId string `json:"trackId"`
}

type RequestData

type RequestData struct {
	Url    string
	Method string

	Token string
	Body  any
}

type Signin added in v0.18.0

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

type SigninBody added in v0.18.0

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

type Signup added in v0.18.0

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

type SignupBody added in v0.18.0

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

type Taglist added in v0.18.0

type Taglist struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Filter  string `json:"filter"`
	Created int    `json:"created"`
	Updated int    `json:"updated"`
}

type Track

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

type TrackId added in v0.18.0

type TrackId struct {
	TrackId string `json:"trackId"`
}

type UpdateTaglistBody added in v0.18.0

type UpdateTaglistBody struct {
	Name   *string `json:"name,omitempty"`
	Filter *string `json:"filter,omitempty"`
}

type UpdateUserSettingsBody added in v0.18.0

type UpdateUserSettingsBody struct {
	DisplayName   *string `json:"displayName,omitempty"`
	QuickPlaylist *string `json:"quickPlaylist,omitempty"`
}

type UploadTrackBody added in v0.18.0

type UploadTrackBody struct {
	Name             string   `json:"name"`
	OtherName        string   `json:"otherName"`
	Number           int      `json:"number"`
	Year             int      `json:"year"`
	AlbumId          string   `json:"albumId"`
	ArtistId         string   `json:"artistId"`
	Tags             []string `json:"tags"`
	FeaturingArtists []string `json:"featuringArtists"`
}

Jump to

Keyboard shortcuts

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