models

package
v0.0.0-...-a1716bb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Status  int         `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type DTOArtist

type DTOArtist struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Href string `json:"href"`
}

func SpArtist2dtoArtist

func SpArtist2dtoArtist(spArtist SpArtist) DTOArtist

func SpArtists2dtoArtists

func SpArtists2dtoArtists(spArtists []SpArtist) []DTOArtist

type DTOFavTracksSnapshot

type DTOFavTracksSnapshot struct {
	Timestamp   int64      `json:"timestamp"`
	TracksCount int        `json:"tracks_count"`
	Tracks      []DTOTrack `json:"tracks"`
}

type DTOPlaylist

type DTOPlaylist struct {
	URI        string     `json:"uri"`
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	TracksHref string     `json:"tracksHref"`
	Tracks     []DTOTrack `json:"tracks"`
}

func SpPlaylist2dtoPlaylist

func SpPlaylist2dtoPlaylist(spPlaylist SpPlaylist, tracks []SpPlaylistTrack) DTOPlaylist

type DTOPlaylistSnapshot

type DTOPlaylistSnapshot struct {
	Timestamp int64         `json:"timestamp"`
	Playlists []DTOPlaylist `json:"playlists"`
}

type DTOTrack

type DTOTrack struct {
	AddedAt     int64       `json:"added_at"`
	AddedBy     string      `json:"added_by"`
	Artists     []DTOArtist `json:"artists"`
	Album       string      `json:"album"`
	URI         string      `json:"uri"`
	ID          string      `json:"id"`
	TrackNumber int         `json:"track_number"`
	DurationMs  int         `json:"duration_ms"`
	Name        string      `json:"name"`
}

func SpAddedTrack2dtoTrack

func SpAddedTrack2dtoTrack(spAddedTrack SpAddedTrack) DTOTrack

func SpPlaylistTrack2dtoPlaylistTrack

func SpPlaylistTrack2dtoPlaylistTrack(spPlTrack SpPlaylistTrack) DTOTrack

func SpTrack2dtoTrack

func SpTrack2dtoTrack(spTrack SpTrack) DTOTrack

type ErrorViewData

type ErrorViewData struct {
	Username string      `json:"username"`
	Title    string      `json:"title"`
	Message  string      `json:"message"`
	Error    string      `json:"error"`
	Data     interface{} `json:"data"`
}

type FavTracksSnapshot

type FavTracksSnapshot struct {
	Username  string         `json:"username"`
	Timestamp time.Time      `json:"timestamp"`
	Tracks    []SpAddedTrack `json:"tracks"`
}

FavTracksSnapshot is an object representing the list of favorite saved tracks of a user

type PlaylistSnapshot

type PlaylistSnapshot struct {
	Playlist SpPlaylist        `json:"playlist"`
	Tracks   []SpPlaylistTrack `json:"tracks"`
}

type PlaylistsSnapshot

type PlaylistsSnapshot struct {
	Username  string             `json:"username"`
	Timestamp time.Time          `json:"timestamp"`
	Playlists []PlaylistSnapshot `json:"playlists"`
}

PlaylistsSnapshot is an object representing the playlist snapshot in time

type SpAPIError

type SpAPIError struct {
	Error SpError `json:"error"`
}

type SpAddedBy

type SpAddedBy struct {
	ExternalUrls SpExternalUrls `json:"external_urls"`
	Href         string         `json:"href"`
	ID           string         `json:"id"`
	Type         string         `json:"type"`
	URI          string         `json:"uri"`
}

type SpAddedTrack

type SpAddedTrack struct {
	AddedAt time.Time `json:"added_at"`
	Track   SpTrack   `json:"track"`
}

type SpAlbum

type SpAlbum struct {
	AlbumType            string     `json:"album_type"`
	Artists              []SpArtist `json:"artists"`
	AvailableMarkets     []string   `json:"available_markets"`
	ExternalUrls         SpURL      `json:"external_urls"`
	Href                 string     `json:"href"`
	ID                   string     `json:"id"`
	Images               []SpImage  `json:"images"`
	Name                 string     `json:"name"`
	ReleaseDate          string     `json:"release_date"`
	ReleaseDatePrecision string     `json:"release_date_precision"`
	TotalTracks          int        `json:"total_tracks"`
	Type                 string     `json:"type"`
	URI                  string     `json:"uri"`
}

type SpArtist

type SpArtist struct {
	ExternalUrls SpURL  `json:"external_urls"`
	Href         string `json:"href"`
	ID           string `json:"id"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	URI          string `json:"uri"`
}

type SpError

type SpError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type SpExplicitContentOptions

type SpExplicitContentOptions struct {
	FilterEnabled bool `json:"filter_enabled"`
	FilterLocked  bool `json:"filter_locked"`
}

type SpExternalIds

type SpExternalIds struct {
	Isrc string `json:"isrc"`
}

type SpExternalUrls

type SpExternalUrls struct {
	Spotify string `json:"spotify"`
}

type SpGetCurrentPlaylistsResp

type SpGetCurrentPlaylistsResp struct {
	SpResponse
	Items []SpPlaylist `json:"items"`
}

type SpGetPlaylistTracksResp

type SpGetPlaylistTracksResp struct {
	SpResponse
	Items []SpPlaylistTrack `json:"items"`
}

type SpGetSavedTracksResp

type SpGetSavedTracksResp struct {
	SpResponse
	Items []SpAddedTrack `json:"items"`
}

type SpImage

type SpImage struct {
	Height int    `json:"height"`
	URL    string `json:"url"`
	Width  int    `json:"width"`
}

type SpLoginError

type SpLoginError struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type SpPlaylist

type SpPlaylist struct {
	Collaborative bool        `json:"collaborative"`
	ExternalUrls  SpURL       `json:"external_urls"`
	Href          string      `json:"href"`
	ID            string      `json:"id"`
	Images        []SpImage   `json:"images"`
	Name          string      `json:"name"`
	Owner         SpUser      `json:"owner"`
	PrimaryColor  interface{} `json:"primary_color"`
	Public        bool        `json:"public"`
	SnapshotID    string      `json:"snapshot_id"`
	Tracks        SpTracks    `json:"tracks"`
	Type          string      `json:"type"`
	URI           string      `json:"uri"`
}

type SpPlaylistTrack

type SpPlaylistTrack struct {
	AddedAt        time.Time        `json:"added_at"`
	AddedBy        SpAddedBy        `json:"added_by"`
	IsLocal        bool             `json:"is_local"`
	PrimaryColor   interface{}      `json:"primary_color"`
	Track          SpTrack          `json:"track"`
	VideoThumbnail SpVideoThumbnail `json:"video_thumbnail"`
}

type SpResponse

type SpResponse struct {
	Href     string `json:"href"`
	Limit    int    `json:"limit"`
	Next     string `json:"next"`
	Offset   int    `json:"offset"`
	Previous string `json:"previous"`
	Total    int    `json:"total"`
}

type SpTrack

type SpTrack struct {
	Album            SpAlbum       `json:"album"`
	Artists          []SpArtist    `json:"artists"`
	AvailableMarkets []string      `json:"available_markets"`
	DiscNumber       int           `json:"disc_number"`
	DurationMs       int           `json:"duration_ms"`
	Explicit         bool          `json:"explicit"`
	ExternalIds      SpExternalIds `json:"external_ids"`
	ExternalUrls     SpURL         `json:"external_urls"`
	Href             string        `json:"href"`
	ID               string        `json:"id"`
	IsLocal          bool          `json:"is_local"`
	Name             string        `json:"name"`
	Popularity       int           `json:"popularity"`
	PreviewURL       string        `json:"preview_url"`
	TrackNumber      int           `json:"track_number"`
	Type             string        `json:"type"`
	URI              string        `json:"uri"`
}

type SpTracks

type SpTracks struct {
	Href  string `json:"href"`
	Total int    `json:"total"`
}

type SpURL

type SpURL struct {
	Spotify string `json:"spotify"`
}

type SpUser

type SpUser struct {
	Birthdate       string                   `json:"birthdate"`
	Country         string                   `json:"country"`
	DisplayName     string                   `json:"display_name"`
	Email           string                   `json:"email"`
	ExplicitContent SpExplicitContentOptions `json:"explicit_content"`
	ExternalUrls    SpURL                    `json:"external_urls"`
	Followers       SpUserFollowers          `json:"followers"`
	Href            string                   `json:"href"`
	ID              string                   `json:"id"`
	Images          []SpImage                `json:"images"`
	Product         string                   `json:"product"`
	Type            string                   `json:"type"`
	URI             string                   `json:"uri"`
}

type SpUserFollowers

type SpUserFollowers struct {
	Href  string `json:"href"`
	Total int    `json:"total"`
}

type SpVideoThumbnail

type SpVideoThumbnail struct {
	URL interface{} `json:"url"`
}

type SpotifyAuthOptions

type SpotifyAuthOptions struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	Scope        string `json:"scope"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

SpotifyAuthOptions is: https://developer.spotify.com/documentation/general/guides/authorization-guide/

func (SpotifyAuthOptions) String

func (ao SpotifyAuthOptions) String() string

type User

type User struct {
	Username string
	Auth     *SpotifyAuthOptions
}

User is an object representing the user of this service, not Spotify

func (User) String

func (u User) String() string

type ViewData

type ViewData struct {
	Username string      `json:"username"`
	Message  string      `json:"message"`
	Data     interface{} `json:"data"`
}

ViewData object returned to frontend clients

Jump to

Keyboard shortcuts

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