88 lines
2.7 KiB
Go
88 lines
2.7 KiB
Go
|
package streams
|
|||
|
|
|||
|
import "time"
|
|||
|
|
|||
|
type Stream struct {
|
|||
|
// An ID that identifies the stream. You can use this ID later to look up the video on demand (VOD).
|
|||
|
ID string `json:"id"`
|
|||
|
|
|||
|
// The ID of the user that’s broadcasting the stream.
|
|||
|
UserID string `json:"user_id"`
|
|||
|
|
|||
|
// The user’s login name.
|
|||
|
UserLogin string `json:"user_login"`
|
|||
|
|
|||
|
// The user’s display name.
|
|||
|
UserName string `json:"user_name"`
|
|||
|
|
|||
|
// The ID of the category or game being played.
|
|||
|
GameID string `json:"game_id"`
|
|||
|
|
|||
|
// The name of the category or game being played.
|
|||
|
GameName string `json:"game_name"`
|
|||
|
|
|||
|
// The type of stream. Possible values are:
|
|||
|
//
|
|||
|
// live
|
|||
|
//
|
|||
|
// If an error occurs, this field is set to an empty string.
|
|||
|
Type string `json:"type"`
|
|||
|
|
|||
|
// The stream’s title. Is an empty string if not set.
|
|||
|
Title string `json:"title"`
|
|||
|
|
|||
|
// The tags applied to the stream.
|
|||
|
Tags []string `json:"tags"`
|
|||
|
|
|||
|
// The number of users watching the stream.
|
|||
|
ViewerCount int `json:"viewer_count"`
|
|||
|
|
|||
|
// The UTC date and time (in RFC3339 format) of when the broadcast began.
|
|||
|
StartedAt time.Time `json:"started_at"`
|
|||
|
|
|||
|
// The language that the stream uses.
|
|||
|
// This is an ISO 639-1 two-letter language code or other if the stream uses a language not in the list of supported stream languages.
|
|||
|
Language string `json:"language"`
|
|||
|
|
|||
|
// A URL to an image of a frame from the last 5 minutes of the stream.
|
|||
|
// Replace the width and height placeholders in the URL ({width}x{height}) with the size of the image you want, in pixels.
|
|||
|
ThumbnailURL string `json:"thumbnail_url"`
|
|||
|
|
|||
|
// A Boolean value that indicates whether the stream is meant for mature audiences.
|
|||
|
IsMature bool `json:"is_mature"`
|
|||
|
}
|
|||
|
|
|||
|
type StreamMarker struct {
|
|||
|
// An ID that identifies this marker.
|
|||
|
ID string `json:"id"`
|
|||
|
|
|||
|
// The UTC date and time (in RFC3339 format) of when the user created the marker.
|
|||
|
CreatedAt time.Time `json:"created_at"`
|
|||
|
|
|||
|
// The relative offset (in seconds) of the marker from the beginning of the stream.
|
|||
|
PositionSeconds int `json:"position_seconds"`
|
|||
|
|
|||
|
// A description that the user gave the marker to help them remember why they marked the location.
|
|||
|
Description string `json:"description"`
|
|||
|
}
|
|||
|
|
|||
|
type StreamMarkers struct {
|
|||
|
// The ID of the user that created the marker.
|
|||
|
UserID string `json:"user_id"`
|
|||
|
|
|||
|
// The user’s display name.
|
|||
|
UserName string `json:"user_name"`
|
|||
|
|
|||
|
// The user’s login name.
|
|||
|
UserLogin string `json:"user_login"`
|
|||
|
|
|||
|
// A list of videos that contain markers. The list contains a single video.
|
|||
|
Videos []struct {
|
|||
|
// An ID that identifies this video.
|
|||
|
VideoID string `json:"video_id"`
|
|||
|
|
|||
|
// The list of markers in this video. The list in ascending order by when the marker was created.
|
|||
|
Markers []StreamMarker `json:"markers"`
|
|||
|
} `json:"videos"`
|
|||
|
}
|