Documentation ¶
Index ¶
Constants ¶
View Source
const (
StarshipURL = "https://www.spacex.com/vehicles/starship/"
)
Variables ¶
View Source
var ErrNoInfo = errors.New("no info")
View Source
var ErrNoVideo = errors.New("not live")
View Source
var ShipNameRegex = regexp.MustCompile(`\b((?:SN|S|Star[Ss]hip)-?\s*\d+)\b`)
Functions ¶
This section is empty.
Types ¶
type LiveBroadcastDetails ¶
type LiveVideo ¶
type LiveVideo struct { VideoID string `json:"videoId"` Title string `json:"title"` IsLive bool `json:"isLive"` ChannelID string `json:"channelId"` ShortDescription string `json:"shortDescription"` IsUpcoming bool `json:"isUpcoming"` UpcomingInfo LiveBroadcastDetails // contains filtered or unexported fields }
This struct only contains minimal info, there is more but I don't care about other info we can get
func YouTubeLive ¶
YouTubeLive extracts a live stream from a channel live url. This kind of URL looks like the following:
https://www.youtube.com/channel/UCSUu1lih2RifWkKtDOJdsBA/live https://www.youtube.com/spacex/live
It also extract streams that are upcoming
type StarshipInfo ¶
type StarshipInfo struct { ShipName string NextFlightDate time.Time Orbital bool LiveStreamID string }
func SpaceXStarship ¶
func SpaceXStarship(websiteURL string, now time.Time) (s StarshipInfo, err error)
SpaceXStarship returns info about the starship page (ship name & first mentioned date)
func (*StarshipInfo) Equals ¶
func (s *StarshipInfo) Equals(b StarshipInfo) bool
Click to show internal directories.
Click to hide internal directories.