model

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Package model is auto generated from model/spec.json - DO NOT EDIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoverArtUrl added in v0.11.11

func CoverArtUrl(releaseGroupId string, size int) string

func FormatDuration

func FormatDuration(d time.Duration) string

func InvokeApi

func InvokeApi(clientId string, data []byte, api Api) (result []byte, err error)

Types

type AlbumCard

type AlbumCard struct {
	ReleaseGroupID string `json:"releasegroupid,omitempty"`
	Album          string `json:"album,omitempty"`
	Artist         string `json:"artist,omitempty"`
}

type AlbumRequest

type AlbumRequest struct {
	ReleaseGroupID string `json:"releasegroupid,omitempty"`
}

func (*AlbumRequest) WebSocketMessage

func (m *AlbumRequest) WebSocketMessage() ([]byte, error)

func (*AlbumRequest) WebSocketMessageName

func (m *AlbumRequest) WebSocketMessageName() string

type AlbumResponse

type AlbumResponse struct {
	ReleaseGroupID string          `json:"releasegroupid,omitempty"`
	Tracks         []*ReleaseTrack `json:"tracks,omitempty"`
}

func (*AlbumResponse) TracksMetadata added in v0.10.4

func (m *AlbumResponse) TracksMetadata() []*Metadata

func (*AlbumResponse) WebSocketMessage

func (m *AlbumResponse) WebSocketMessage() ([]byte, error)

func (*AlbumResponse) WebSocketMessageName

func (m *AlbumResponse) WebSocketMessageName() string

type AlbumsRequest

type AlbumsRequest struct {
	Query string `json:"query,omitempty"`
}

func (*AlbumsRequest) WebSocketMessage

func (m *AlbumsRequest) WebSocketMessage() ([]byte, error)

func (*AlbumsRequest) WebSocketMessageName

func (m *AlbumsRequest) WebSocketMessageName() string

type AlbumsResponse

type AlbumsResponse struct {
	Results []*AlbumCard `json:"results,omitempty"`
}

func (*AlbumsResponse) WebSocketMessage

func (m *AlbumsResponse) WebSocketMessage() ([]byte, error)

func (*AlbumsResponse) WebSocketMessageName

func (m *AlbumsResponse) WebSocketMessageName() string

type Api

type Api interface {
	Ping(clientId string, request *PingRequest) (response *PingResponse, err error)
	Search(clientId string, request *SearchRequest) (response *SearchResponse, err error)
	Albums(clientId string, request *AlbumsRequest) (response *AlbumsResponse, err error)
	Album(clientId string, request *AlbumRequest) (response *AlbumResponse, err error)
	PlayLists(clientId string, request *PlayListsRequest) (response *PlayListsResponse, err error)
	RandomTrack(clientId string, request *RandomTrackRequest) (response *RandomTrackResponse, err error)
}

type Metadata

type Metadata struct {
	Path                      string    `json:"path,omitempty"`
	Size                      int64     `json:"size,omitempty"`
	ModTime                   time.Time `json:"mod_time,omitempty"`
	Album                     string    `json:"album,omitempty"`
	AlbumArtist               string    `json:"albumartist,omitempty"`
	Artist                    string    `json:"artist,omitempty"`
	Composer                  string    `json:"composer,omitempty"`
	Date                      string    `json:"date,omitempty"`
	DiscNumber                string    `json:"discnumber,omitempty"`
	DiscTotal                 string    `json:"disctotal,omitempty"`
	MusicbrainzAlbumArtistId  string    `json:"musicbrainz_albumartistid,omitempty"`
	MusicbrainzAlbumId        string    `json:"musicbrainz_albumid,omitempty"`
	MusicbrainzArtistId       string    `json:"musicbrainz_artistid,omitempty"`
	MusicbrainzReleaseGroupId string    `json:"musicbrainz_releasegroupid,omitempty"`
	MusicbrainzReleaseTrackId string    `json:"musicbrainz_releasetrackid,omitempty"`
	MusicbrainzTrackId        string    `json:"musicbrainz_trackid,omitempty"`
	MusicbrainzWorkId         string    `json:"musicbrainz_workid,omitempty"`
	Performer                 string    `json:"performer,omitempty"`
	Title                     string    `json:"title,omitempty"`
	TrackNumber               string    `json:"tracknumber,omitempty"`
	TrackTotal                string    `json:"tracktotal,omitempty"`
	Seconds                   uint64    `json:"seconds,omitempty"`
}

func (*Metadata) CoverArtUrl added in v0.11.11

func (md *Metadata) CoverArtUrl(size int) string

func (*Metadata) FlacUrl

func (md *Metadata) FlacUrl() string

func (*Metadata) FormattedDuration

func (md *Metadata) FormattedDuration() string

func (*Metadata) ReleaseDiscTrackID

func (md *Metadata) ReleaseDiscTrackID() string

type NatsBackend added in v0.11.16

type NatsBackend interface {
	Start() error

	Stop()
}

func NewNatsBackend added in v0.11.16

func NewNatsBackend(ctx context.Context, conn *natsgo.Conn, api NatsBackendApi) (backend NatsBackend)

type NatsBackendApi added in v0.11.16

type NatsBackendApi interface {
	Ping(request *PingRequest) (response *PingResponse)

	Search(request *SearchRequest) (response *SearchResponse)

	Albums(request *AlbumsRequest) (response *AlbumsResponse)

	Album(request *AlbumRequest) (response *AlbumResponse)

	PlayLists(request *PlayListsRequest) (response *PlayListsResponse)

	RandomTrack(request *RandomTrackRequest) (response *RandomTrackResponse)
}

type NatsClientApi added in v0.11.16

type NatsClientApi interface {
	Ping(request *PingRequest, timeout time.Duration) (response *PingResponse, err error)

	Search(request *SearchRequest, timeout time.Duration) (response *SearchResponse, err error)

	Albums(request *AlbumsRequest, timeout time.Duration) (response *AlbumsResponse, err error)

	Album(request *AlbumRequest, timeout time.Duration) (response *AlbumResponse, err error)

	PlayLists(request *PlayListsRequest, timeout time.Duration) (response *PlayListsResponse, err error)

	RandomTrack(request *RandomTrackRequest, timeout time.Duration) (response *RandomTrackResponse, err error)
}

func NewNatsClientApi added in v0.11.16

func NewNatsClientApi(conn *natsgo.Conn) (api NatsClientApi)

type PingRequest added in v0.11.12

type PingRequest struct {
	Query string `json:"query,omitempty"`
}

func (*PingRequest) WebSocketMessage added in v0.11.12

func (m *PingRequest) WebSocketMessage() ([]byte, error)

func (*PingRequest) WebSocketMessageName added in v0.11.12

func (m *PingRequest) WebSocketMessageName() string

type PingResponse added in v0.11.12

type PingResponse struct {
	Query string `json:"query,omitempty"`
}

func (*PingResponse) WebSocketMessage added in v0.11.12

func (m *PingResponse) WebSocketMessage() ([]byte, error)

func (*PingResponse) WebSocketMessageName added in v0.11.12

func (m *PingResponse) WebSocketMessageName() string

type PlayList

type PlayList struct {
	Name         string      `json:"name,omitempty"`
	CurrentIndex int64       `json:"current_index,omitempty"`
	Tracks       []*Metadata `json:"tracks,omitempty"`
}

type PlayListsRequest

type PlayListsRequest struct {
	Names []string `json:"names,omitempty"`
}

func (*PlayListsRequest) WebSocketMessage

func (m *PlayListsRequest) WebSocketMessage() ([]byte, error)

func (*PlayListsRequest) WebSocketMessageName

func (m *PlayListsRequest) WebSocketMessageName() string

type PlayListsResponse

type PlayListsResponse struct {
	PlayLists []*PlayList `json:"play_lists,omitempty"`
}

func (*PlayListsResponse) WebSocketMessage

func (m *PlayListsResponse) WebSocketMessage() ([]byte, error)

func (*PlayListsResponse) WebSocketMessageName

func (m *PlayListsResponse) WebSocketMessageName() string

type RandomTrackRequest added in v0.11.12

type RandomTrackRequest struct{}

func (*RandomTrackRequest) WebSocketMessage added in v0.11.12

func (m *RandomTrackRequest) WebSocketMessage() ([]byte, error)

func (*RandomTrackRequest) WebSocketMessageName added in v0.11.12

func (m *RandomTrackRequest) WebSocketMessageName() string

type RandomTrackResponse added in v0.11.12

type RandomTrackResponse struct {
	Metadata *Metadata `json:"metadata,omitempty"`
}

func (*RandomTrackResponse) WebSocketMessage added in v0.11.12

func (m *RandomTrackResponse) WebSocketMessage() ([]byte, error)

func (*RandomTrackResponse) WebSocketMessageName added in v0.11.12

func (m *RandomTrackResponse) WebSocketMessageName() string

type ReleaseGroup

type ReleaseGroup struct {
	ID       string          `json:"ID,omitempty"`
	CoverArt string          `json:"CoverArt,omitempty"`
	SortKey  string          `json:"SortKey,omitempty"`
	Tracks   []*ReleaseTrack `json:"Tracks,omitempty"`
}

type ReleaseGroupsResponse

type ReleaseGroupsResponse struct {
	Groups []*ReleaseGroup `json:"release_groups,omitempty"`
}

type ReleaseTrack

type ReleaseTrack struct {
	ID       string    `json:"ID,omitempty"`
	Metadata *Metadata `json:"Metadata,omitempty"`
}

type SearchRequest

type SearchRequest struct {
	Search string `json:"search,omitempty"`
}

func (*SearchRequest) WebSocketMessage

func (m *SearchRequest) WebSocketMessage() ([]byte, error)

func (*SearchRequest) WebSocketMessageName

func (m *SearchRequest) WebSocketMessageName() string

type SearchResponse

type SearchResponse struct {
	Results []*Metadata `json:"results,omitempty"`
}

func (*SearchResponse) WebSocketMessage

func (m *SearchResponse) WebSocketMessage() ([]byte, error)

func (*SearchResponse) WebSocketMessageName

func (m *SearchResponse) WebSocketMessageName() string

type WebSocketMessage

type WebSocketMessage interface {
	WebSocketMessage() ([]byte, error)
	WebSocketMessageName() string
}

func DecodeMessage added in v0.11.16

func DecodeMessage(data []byte) (result WebSocketMessage, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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