zap2it

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLGuideEndpoint = "https://tvlistings.zap2it.com/api/grid"
	URLIconPrefix    = "http://zap2it.tmsimg.com/assets"
)
View Source
const (
	URLListingProvidersEndpoint = "https://tvlistings.zap2it.com/gapzap_webapi/api/Providers/getPostalCodeProviders"
)
View Source
const (
	URLTokenEndpoint = "https://tvlistings.zap2it.com/api/user/login"
)

Variables

View Source
var (
	ErrBadRequest          = errors.New("bad request")
	ErrInternalServerError = errors.New("internal server error")
	ErrInvalidCredentials  = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type ChannelResponse

type ChannelResponse struct {
	CallSign          string          `json:"callSign"`
	AffiliateName     string          `json:"affiliateName"`
	AffiliateCallSign string          `json:"affiliateCallSign"`
	ChannelID         string          `json:"channelId"`
	ChannelNumber     string          `json:"channelNo"`
	Thumbnail         string          `json:"thumbnail"`
	Events            []EventResponse `json:"events"`
}

type EventResponse

type EventResponse struct {
	CallSign      string          `json:"callSign"`
	Duration      string          `json:"duration"`
	StartTime     string          `json:"startTime"`
	EndTime       string          `json:"endTime"`
	Thumbnail     string          `json:"thumbnail"`
	ChannelNumber string          `json:"channelNo"`
	SeriesID      string          `json:"seriesId"`
	Rating        string          `json:"rating"`
	Filters       []string        `json:"filter"`
	Flags         []string        `json:"flags"`
	Tags          []string        `json:"tags"`
	Program       ProgramResponse `json:"program"`
}

func (*EventResponse) GetIconURL

func (e *EventResponse) GetIconURL() string

func (*EventResponse) GetURL

func (e *EventResponse) GetURL() string

type GuideRequest

type GuideRequest struct {
	Token         string `json:"token"`
	LineupID      string `json:"lineupId"`
	HeadEndID     string `json:"headendId"`
	Device        string `json:"device"`
	CountryCode   string `json:"country"`
	ZipCode       string `json:"postalCode"`
	UnixTimestamp int64  `json:"time"`
}

type GuideResponse

type GuideResponse struct {
	Channels []ChannelResponse `json:"channels"`
}

func GetGuideResponse

func GetGuideResponse(request GuideRequest) (GuideResponse, error)

type ListingProvidersResponse

type ListingProvidersResponse struct {
	DSTUTCOffset string `json:"DSTUTCOffset"`
	STDUTCOffset string `json:"StdUTCOffset"`
	DSTStart     string `json:"DSTStart"`
	DSTEnd       string `json:"DSTEnd"`
	Primetime    string `json:"primetime"`
	Providers    []ProviderResponse
}

func GetProvidersResponse

func GetProvidersResponse(countryCode, zipCode, language string) (ListingProvidersResponse, error)

type ProgramResponse

type ProgramResponse struct {
	ID               string `json:"id"`
	Title            string `json:"title"`
	TMSID            string `json:"tmsId"`
	ShortDescription string `json:"shortDescription"`
	Season           string `json:"season"`
	ReleaseYear      string `json:"releaseYear"`
	Episode          string `json:"episode"`
	EpisodeTitle     string `json:"episodeTitle"`
	SeriesID         string `json:"seriesId"`
}

type ProviderResponse

type ProviderResponse struct {
	Name              string `json:"name"`
	Type              string `json:"type"`
	Device            string `json:"device"`
	LineupID          string `json:"lineupID"`
	HeadEndID         string `json:"headendID"`
	Location          string `json:"location"`
	Timezone          string `json:"timezone"`
	IsDefaultProvider string `json:"isDefaultProvider"`
	PostalCode        string `json:"postalCode"`
}

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
	Name  string `json:"name"`
}

func GetTokenResponse

func GetTokenResponse(username, password string) (TokenResponse, error)

Jump to

Keyboard shortcuts

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