0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2025-01-22 04:12:30 -05:00

Allow struct to work for any api response

This commit is contained in:
dragongoose 2023-05-20 17:18:23 -04:00
parent bb8b868354
commit 3114476a6b

View file

@ -1,61 +1,8 @@
package structs
import "time"
type StreamerDataRaw struct {
Data Data `json:"data"`
Extensions Extensions `json:"extensions"`
}
type Followers struct {
TotalCount int `json:"totalCount"`
}
type SocialMedias struct {
ID string `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
URL string `json:"url"`
}
type NextSegment struct {
ID string `json:"id"`
StartAt time.Time `json:"startAt"`
HasReminder bool `json:"hasReminder"`
}
type Schedule struct {
ID string `json:"id"`
NextSegment NextSegment `json:"nextSegment"`
}
type Channel struct {
ID string `json:"id"`
SocialMedias []SocialMedias `json:"socialMedias"`
Schedule Schedule `json:"schedule"`
}
type Game struct {
ID string `json:"id"`
DisplayName string `json:"displayName"`
}
type LastBroadcast struct {
ID string `json:"id"`
Game Game `json:"game"`
}
type PrimaryTeam struct {
ID string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
}
type User struct {
ID string `json:"id"`
Description string `json:"description"`
DisplayName string `json:"displayName"`
IsPartner bool `json:"isPartner"`
PrimaryColorHex string `json:"primaryColorHex"`
ProfileImageURL string `json:"profileImageURL"`
Followers Followers `json:"followers"`
Channel Channel `json:"channel"`
LastBroadcast LastBroadcast `json:"lastBroadcast"`
PrimaryTeam PrimaryTeam `json:"primaryTeam"`
}
type Data struct {
User User `json:"user"`
type TwitchApiResponse struct {
Data map[string]interface{} `json:"data"`
Extensions Extensions `json:"extensions"`
}
type Extensions struct {
DurationMilliseconds int `json:"durationMilliseconds"`