-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.go
98 lines (87 loc) · 2.25 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package main
import (
"time"
spotify "github.com/chew-z/spotify"
"golang.org/x/oauth2"
)
type firestoreTrack struct {
Name string `firestore:"track_name"`
Artists string `firestore:"artists"`
PlayedAt time.Time `firestore:"played_at"`
ID string `firestore:"id,omitempty"`
}
// TODO - used only once
type popularTrack struct {
Count int `firestore:"count,omitempty"`
}
// the name - this is what we need to
// retrieve token form firestore and for some
//initialization
type firestoreToken struct {
user string `firestore:"userID"` // Spotify user ID
displayname string `firestore:"user_displayname,omitempty"`
email string `firestore:"user_email,omitempty"`
premium bool `firestore:"premium_user,omitempty"`
expiration time.Time `firestore:"subscription_expires,omitempty"`
country string `firestore:"country,omitempty"` // The country of the user, as set in the user's account profile
path string // authorization path (gin routes group)
token *oauth2.Token // Spotify token
}
type navigation struct {
Endpoint string
Title string
Previous string
Current string
Next string
Back string
Here string
}
type recommendationParameters struct {
Seeds spotify.Seeds
TrackAttributes *spotify.TrackAttributes
FromYear int
MinTrackCount int
}
// TODO - its just tracks now, not topTracks
type topTrack struct {
Count int
Name string
Artists string
URL string
Album string
Image string
Placeholder string
}
type audioTrack struct {
ID spotify.ID
Name string
Artists string
Instrumentalness int
Acousticness int
Energy int
Loudness int
Tempo int
URL string
Image string
}
// (used for sending sruct to frontend)
type frontendAlbumPlaylist struct {
ID string
Name string
Artists string
URL string
Image string
Placeholder string
Owner string
Tracks int
}
type userLocation struct {
Name string
Premium bool
Expiration time.Time
URL string
Country string
Lat string
Lon string
City string
}