Documentation
¶
Index ¶
- Constants
- Variables
- func GetWebhookTopicValuesFromRequest(req *http.Request, topic WebhookTopic) map[string]string
- func VerifyEventSubNotification(secret string, header http.Header, message string) bool
- type AccessCredentials
- type AdDetails
- type AdLengthEnum
- type AppAccessTokenResponse
- type AuthorizationURLParams
- type BadgeVersion
- type Ban
- type BannedUsersParams
- type BannedUsersResponse
- type BitsLeaderboardParams
- type BitsLeaderboardResponse
- type BlockUserParams
- type BlockUserResponse
- type Channel
- type ChannelCustomReward
- type ChannelCustomRewardResponse
- type ChannelCustomRewardsParams
- type ChannelEditor
- type ChannelEditorsParams
- type ChannelEditorsResponse
- type ChannelInformation
- type ChatBadge
- type CheermoteTierImages
- type CheermoteTiers
- type Cheermotes
- type CheermotesParams
- type CheermotesResponse
- type Client
- func (c *Client) BlockUser(params *BlockUserParams) (*BlockUserResponse, error)
- func (c *Client) CheckUserSubscription(params *UserSubscriptionsParams) (*UserSubscriptionResponse, error)
- func (c *Client) CreateClip(params *CreateClipParams) (*CreateClipResponse, error)
- func (c *Client) CreateCustomReward(params *ChannelCustomRewardsParams) (*ChannelCustomRewardResponse, error)
- func (c *Client) CreateEntitlementsUploadURL(manifestID, entitlementType string) (*EntitlementsUploadResponse, error)
- func (c *Client) CreateEventSubSubscription(payload *EventSubSubscription) (*EventSubSubscriptionsResponse, error)
- func (c *Client) CreateExtensionSecret(params *ExtensionSecretCreationParams) (*ExtensionSecretCreationResponse, error)
- func (c *Client) CreatePoll(params *CreatePollParams) (*PollsResponse, error)
- func (c *Client) CreatePrediction(params *CreatePredictionParams) (*PredictionsResponse, error)
- func (c *Client) CreateStreamMarker(params *CreateStreamMarkerParams) (*CreateStreamMarkerResponse, error)
- func (c *Client) DeleteCustomRewards(params *DeleteCustomRewardsParams) (*DeleteCustomRewardsResponse, error)
- func (c *Client) DeleteVideos(params *DeleteVideosParams) (*DeleteVideosResponse, error)
- func (c *Client) EditChannelInformation(params *EditChannelInformationParams) (*EditChannelInformationResponse, error)
- func (c *Client) EndPoll(params *EndPollParams) (*PollsResponse, error)
- func (c *Client) EndPrediction(params *EndPredictionParams) (*PredictionsResponse, error)
- func (c *Client) ExtensionCreateClaims(params *ExtensionCreateClaimsParams) (*TwitchJWTClaims, error)
- func (c *Client) ExtensionJWTSign(claims *TwitchJWTClaims) (tokenString string, err error)
- func (c *Client) ExtensionJWTVerify(token string) (claims *TwitchJWTClaims, err error)
- func (c *Client) FormBroadcastSendPubSubPermissions() *PubSubPermissions
- func (c *Client) FormGenericPubSubPermissions() *PubSubPermissions
- func (c *Client) FormGlobalSendPubSubPermissions() *PubSubPermissions
- func (c *Client) FormWhisperSendPubSubPermissions(opaqueId string) *PubSubPermissions
- func (c *Client) GetAppAccessToken() string
- func (c *Client) GetAuthorizationURL(params *AuthorizationURLParams) string
- func (c *Client) GetBannedUsers(params *BannedUsersParams) (*BannedUsersResponse, error)
- func (c *Client) GetBitsLeaderboard(params *BitsLeaderboardParams) (*BitsLeaderboardResponse, error)
- func (c *Client) GetChannelChatBadges(params *GetChatBadgeParams) (*GetChatBadgeResponse, error)
- func (c *Client) GetChannelEditors(params *ChannelEditorsParams) (*ChannelEditorsResponse, error)
- func (c *Client) GetChannelEmotes(params *GetChannelEmotesParams) (*GetChannelEmotesResponse, error)
- func (c *Client) GetChannelInformation(params *GetChannelInformationParams) (*GetChannelInformationResponse, error)
- func (c *Client) GetCheermotes(params *CheermotesParams) (*CheermotesResponse, error)
- func (c *Client) GetClips(params *ClipsParams) (*ClipsResponse, error)
- func (c *Client) GetCreatorGoals(payload *GetCreatorGoalsParams) (*CreatorGoalsResponse, error)
- func (c *Client) GetCustomRewards(params *GetCustomRewardsParams) (*ChannelCustomRewardResponse, error)
- func (c *Client) GetDropsEntitlements(params *GetDropEntitlementsParams) (*GetDropsEntitlementsResponse, error)
- func (c *Client) GetEmoteSets(params *GetEmoteSetsParams) (*GetEmoteSetsResponse, error)
- func (c *Client) GetEntitlementCodeStatus(params *CodesParams) (*CodeResponse, error)
- func (c *Client) GetEventSubSubscriptions(params *EventSubSubscriptionsParams) (*EventSubSubscriptionsResponse, error)
- func (c *Client) GetExtensionAnalytics(params *ExtensionAnalyticsParams) (*ExtensionAnalyticsResponse, error)
- func (c *Client) GetExtensionConfigurationSegment(params *ExtensionGetConfigurationParams) (*ExtensionGetConfigurationSegmentResponse, error)
- func (c *Client) GetExtensionLiveChannels(params *ExtensionLiveChannelsParams) (*ExtensionLiveChannelsResponse, error)
- func (c *Client) GetExtensionSecrets(params *GetExtensionSecretParams) (*GetExtensionSecretResponse, error)
- func (c *Client) GetExtensionSignedJWTToken() string
- func (c *Client) GetExtensionTransactions(params *ExtensionTransactionsParams) (*ExtensionTransactionsResponse, error)
- func (c *Client) GetFollowedStream(params *FollowedStreamsParams) (*StreamsResponse, error)
- func (c *Client) GetGameAnalytics(params *GameAnalyticsParams) (*GameAnalyticsResponse, error)
- func (c *Client) GetGames(params *GamesParams) (*GamesResponse, error)
- func (c *Client) GetGlobalChatBadges() (*GetChatBadgeResponse, error)
- func (c *Client) GetGlobalEmotes() (*GetChannelEmotesResponse, error)
- func (c *Client) GetHypeTrainEvents(params *HypeTrainEventsParams) (*HypeTrainEventsResponse, error)
- func (c *Client) GetPolls(params *PollsParams) (*PollsResponse, error)
- func (c *Client) GetPredictions(params *PredictionsParams) (*PredictionsResponse, error)
- func (c *Client) GetStreamKey(params *StreamKeyParams) (*StreamsResponse, error)
- func (c *Client) GetStreamMarkers(params *StreamMarkersParams) (*StreamMarkersResponse, error)
- func (c *Client) GetStreams(params *StreamsParams) (*StreamsResponse, error)
- func (c *Client) GetSubscriptions(params *SubscriptionsParams) (*SubscriptionsResponse, error)
- func (c *Client) GetTopGames(params *TopGamesParams) (*TopGamesResponse, error)
- func (c *Client) GetUserAccessToken() string
- func (c *Client) GetUserActiveExtensions(params *UserActiveExtensionsParams) (*UserActiveExtensionsResponse, error)
- func (c *Client) GetUserExtensions() (*UserExtensionsResponse, error)
- func (c *Client) GetUsers(params *UsersParams) (*UsersResponse, error)
- func (c *Client) GetUsersBlocked(params *UsersBlockedParams) (*UsersBlockedResponse, error)
- func (c *Client) GetUsersFollows(params *UsersFollowsParams) (*UsersFollowsResponse, error)
- func (c *Client) GetVideos(params *VideosParams) (*VideosResponse, error)
- func (c *Client) GetWebhookSubscriptions(params *WebhookSubscriptionsParams) (*WebhookSubscriptionsResponse, error)
- func (c *Client) ModerateHeldMessage(params *HeldMessageModerationParams) (*HeldMessageModerationResponse, error)
- func (c *Client) PostWebhookSubscription(payload *WebhookSubscriptionPayload) (*WebhookSubscriptionResponse, error)
- func (c *Client) RedeemEntitlementCode(params *CodesParams) (*CodeResponse, error)
- func (c *Client) RefreshUserAccessToken(refreshToken string) (*RefreshTokenResponse, error)
- func (c *Client) RemoveEventSubSubscription(id string) (*RemoveEventSubSubscriptionParamsResponse, error)
- func (c *Client) RequestAppAccessToken(scopes []string) (*AppAccessTokenResponse, error)
- func (c *Client) RequestUserAccessToken(code string) (*UserAccessTokenResponse, error)
- func (c *Client) RevokeUserAccessToken(accessToken string) (*RevokeAccessTokenResponse, error)
- func (c *Client) SearchChannels(params *SearchChannelsParams) (*SearchChannelsResponse, error)
- func (c *Client) SendExtensionChatMessage(params *ExtensionSendChatMessageParams) (*ExtensionSendChatMessageResponse, error)
- func (c *Client) SendExtensionPubSubMessage(params *ExtensionSendPubSubMessageParams) (*ExtensionSendPubSubMessageResponse, error)
- func (c *Client) SetAppAccessToken(accessToken string)
- func (c *Client) SetExtensionRequiredConfiguration(params *ExtensionSetRequiredConfigurationParams) (*ExtensionSetRequiredConfigurationResponse, error)
- func (c *Client) SetExtensionSegmentConfig(params *ExtensionSetConfigurationParams) (*ExtensionSetConfigurationResponse, error)
- func (c *Client) SetExtensionSignedJWTToken(jwt string)
- func (c *Client) SetRedirectURI(uri string)
- func (c *Client) SetUserAccessToken(accessToken string)
- func (c *Client) SetUserAgent(userAgent string)
- func (c *Client) StartCommercial(params *StartCommercialParams) (*StartCommercialResponse, error)
- func (c *Client) UnblockUser(params *UnblockUserParams) (*BlockUserResponse, error)
- func (c *Client) UpdateDropsEntitlements(params *UpdateDropsEntitlementsParams) (*UpdateDropsEntitlementsResponse, error)
- func (c *Client) UpdateUser(params *UpdateUserParams) (*UsersResponse, error)
- func (c *Client) UpdateUserExtensions(payload *UpdateUserExtensionsPayload) (*UserActiveExtensionsResponse, error)
- func (c *Client) ValidateToken(accessToken string) (bool, *ValidateTokenResponse, error)
- type Clip
- type ClipEditURL
- type ClipsParams
- type ClipsResponse
- type CodeResponse
- type CodeStatus
- type CodesParams
- type CreateClipParams
- type CreateClipResponse
- type CreatePollParams
- type CreatePredictionParams
- type CreateStreamMarker
- type CreateStreamMarkerParams
- type CreateStreamMarkerResponse
- type CreatorGoalsResponse
- type DateRange
- type DeleteCustomRewardsParams
- type DeleteCustomRewardsResponse
- type DeleteVideosParams
- type DeleteVideosResponse
- type EditChannelInformationParams
- type EditChannelInformationResponse
- type Emote
- type EmoteImage
- type EmoteWithOwner
- type EndPollParams
- type EndPredictionParams
- type Entitlement
- type EntitlementCodeStatus
- type EntitlementsUploadResponse
- type EntitlementsUploadURL
- type EventSubBitVoting
- type EventSubChannelBanEvent
- type EventSubChannelCheerEvent
- type EventSubChannelFollowEvent
- type EventSubChannelGoalEndEvent
- type EventSubChannelGoalProgressEvent
- type EventSubChannelGoalStartEvent
- type EventSubChannelPointsCustomRewardEvent
- type EventSubChannelPointsCustomRewardRedemptionEvent
- type EventSubChannelPointsVoting
- type EventSubChannelPollBeginEvent
- type EventSubChannelPollEndEvent
- type EventSubChannelPollProgressEvent
- type EventSubChannelPredictionBeginEvent
- type EventSubChannelPredictionEndEvent
- type EventSubChannelPredictionLockEvent
- type EventSubChannelPredictionProgressEvent
- type EventSubChannelRaidEvent
- type EventSubChannelSubscribeEvent
- type EventSubChannelSubscriptionGiftEvent
- type EventSubChannelSubscriptionMessageEvent
- type EventSubChannelUnbanEvent
- type EventSubChannelUpdateEvent
- type EventSubCondition
- type EventSubContribution
- type EventSubEmote
- type EventSubExtensionBitsTransactionCreateEvent
- type EventSubGlobalCooldown
- type EventSubHypeTrainBeginEvent
- type EventSubHypeTrainEndEvent
- type EventSubHypeTrainProgressEvent
- type EventSubImage
- type EventSubMaxPerStream
- type EventSubMessage
- type EventSubModeratorAddEvent
- type EventSubModeratorRemoveEvent
- type EventSubOutcome
- type EventSubProduct
- type EventSubReward
- type EventSubStreamOfflineEvent
- type EventSubStreamOnlineEvent
- type EventSubSubscription
- type EventSubSubscriptionsParams
- type EventSubSubscriptionsResponse
- type EventSubTopPredictor
- type EventSubTransport
- type EventSubUserAuthenticationRevokeEvent
- type EventSubUserUpdateEvent
- type ExtensionAnalytic
- type ExtensionAnalyticsParams
- type ExtensionAnalyticsResponse
- type ExtensionConfigurationSegment
- type ExtensionCreateClaimsParams
- type ExtensionGetConfigurationParams
- type ExtensionGetConfigurationSegmentResponse
- type ExtensionLiveChannel
- type ExtensionLiveChannelsParams
- type ExtensionLiveChannelsResponse
- type ExtensionOptions
- type ExtensionPubSubPublishType
- type ExtensionSecretCreationParams
- type ExtensionSecretCreationResponse
- type ExtensionSegmentType
- type ExtensionSendChatMessageParams
- type ExtensionSendChatMessageResponse
- type ExtensionSendPubSubMessageParams
- type ExtensionSendPubSubMessageResponse
- type ExtensionSetConfigurationParams
- type ExtensionSetConfigurationResponse
- type ExtensionSetRequiredConfigurationParams
- type ExtensionSetRequiredConfigurationResponse
- type ExtensionTransaction
- type ExtensionTransactionsParams
- type ExtensionTransactionsResponse
- type FollowedStreamsParams
- type Game
- type GameAnalytic
- type GameAnalyticsParams
- type GameAnalyticsResponse
- type GamesParams
- type GamesResponse
- type GetChannelEmotesParams
- type GetChannelEmotesResponse
- type GetChannelInformationParams
- type GetChannelInformationResponse
- type GetChatBadgeParams
- type GetChatBadgeResponse
- type GetCreatorGoalsParams
- type GetCustomRewardsParams
- type GetDropEntitlementsParams
- type GetDropsEntitlementsResponse
- type GetEmoteSetsParams
- type GetEmoteSetsResponse
- type GetExtensionSecretParams
- type GetExtensionSecretResponse
- type GetPollsResponse
- type GetPredictionsResponse
- type GlobalCooldownSettings
- type Goal
- type HTTPClient
- type HeldMessageModerationParams
- type HeldMessageModerationResponse
- type HypeTrainContribuition
- type HypeTrainEvent
- type HypeTrainEventData
- type HypeTrainEventsParams
- type HypeTrainEventsResponse
- type ManyAdDetails
- type ManyBans
- type ManyChannelCustomRewards
- type ManyChannelEditors
- type ManyChannelInformation
- type ManyChatBadge
- type ManyCheermotes
- type ManyClipEditURLs
- type ManyClips
- type ManyCodes
- type ManyCreateStreamMarkers
- type ManyEmotes
- type ManyEmotesWithOwner
- type ManyEntitlements
- type ManyEntitlementsUploadURLs
- type ManyEntitlementsWithPagination
- type ManyEventSubSubscriptions
- type ManyExtensionAnalytics
- type ManyExtensionConfigurationSegments
- type ManyExtensionLiveChannels
- type ManyExtensionSecrets
- type ManyExtensionTransactions
- type ManyFollows
- type ManyGameAnalytics
- type ManyGames
- type ManyGamesWithPagination
- type ManyGoals
- type ManyHypeTrainEvents
- type ManyPolls
- type ManyPredictions
- type ManySearchChannels
- type ManyStreamMarkers
- type ManyStreams
- type ManySubscriptions
- type ManyUpdatedEntitlementSet
- type ManyUserBitTotals
- type ManyUserExtensions
- type ManyUserSubscriptions
- type ManyUsers
- type ManyUsersBlocked
- type ManyVideos
- type ManyWebhookSubscriptions
- type Marker
- type MaxPerStreamSettings
- type MaxPerUserPerStreamSettings
- type Options
- type Outcomes
- type Pagination
- type Poll
- type PollChoice
- type PollChoiceParam
- type PollsParams
- type PollsResponse
- type Prediction
- type PredictionChoiceParam
- type PredictionsParams
- type PredictionsResponse
- type PubSubPermissions
- type RateLimitFunc
- type RefreshTokenResponse
- type RemoveEventSubSubscriptionParams
- type RemoveEventSubSubscriptionParamsResponse
- type Response
- type ResponseCommon
- type RevokeAccessTokenResponse
- type RewardImage
- type RoleType
- type SearchChannelsParams
- type SearchChannelsResponse
- type Secret
- type SecretsInformation
- type StartCommercialParams
- type StartCommercialResponse
- type Stream
- type StreamKeyParams
- type StreamMarker
- type StreamMarkersParams
- type StreamMarkersResponse
- type StreamsParams
- type StreamsResponse
- type Subscription
- type SubscriptionsParams
- type SubscriptionsResponse
- type TierImageTypes
- type TierImages
- type Time
- type TopGamesParams
- type TopGamesResponse
- type TopPredictor
- type TwitchJWTClaims
- type UnblockUserParams
- type UpdateDropsEntitlementsParams
- type UpdateDropsEntitlementsResponse
- type UpdateUserExtensionsPayload
- type UpdateUserParams
- type UpdatedEntitlementSet
- type User
- type UserAccessTokenResponse
- type UserActiveExtension
- type UserActiveExtensionInfo
- type UserActiveExtensionSet
- type UserActiveExtensionsParams
- type UserActiveExtensionsResponse
- type UserBitTotal
- type UserBlocked
- type UserExtension
- type UserExtensionsResponse
- type UserFollow
- type UserSubscription
- type UserSubscriptionResponse
- type UserSubscriptionsParams
- type UsersBlockedParams
- type UsersBlockedResponse
- type UsersFollowsParams
- type UsersFollowsResponse
- type UsersParams
- type UsersResponse
- type ValidateTokenResponse
- type Video
- type VideoMarker
- type VideoMutedSegment
- type VideosParams
- type VideosResponse
- type WebhookSubscription
- type WebhookSubscriptionPayload
- type WebhookSubscriptionResponse
- type WebhookSubscriptionsParams
- type WebhookSubscriptionsResponse
- type WebhookTopic
Constants ¶
const ( SUCCESSFULLY_REDEEMED EntitlementCodeStatus = "SUCCESSFULLY_REDEEMED" ALREADY_CLAIMED = "ALREADY_CLAIMED" EXPIRED = "EXPIRED" USER_NOT_ELIGIBLE = "USER_NOT_ELIGIBLE" NOT_FOUND = "NOT_FOUND" INACTIVE = "INACTIVE" UNUSED = "UNUSED" INCORRECT_FORMAT = "INCORRECT_FORMAT" INTERNAL_ERROR = "INTERNAL_ERROR" )
const ( EventSubStatusEnabled = "enabled" EventSubStatusPending = "webhook_callback_verification_pending" EventSubStatusFailed = "webhook_callback_verification_failed" EventSubStatusNotificationFailuresExceeded = "notification_failures_exceeded" EventSubStatusAuthorizationRevoked = "authorization_revoked" EventSubStatusUserRemoved = "user_removed" EventSubTypeChannelGoalBegin = "channel.goal.begin" EventSubTypeChannelGoalProgress = "channel.goal.progress" EventSubTypeChannelGoalEnd = "channel.goal.end" EventSubTypeChannelUpdate = "channel.update" EventSubTypeChannelFollow = "channel.follow" EventSubTypeChannelSubscription = "channel.subscribe" EventSubTypeChannelSubscriptionEnd = "channel.subscription.end" EventSubTypeChannelSubscriptionGift = "channel.subscription.gift" EventSubTypeChannelSubscriptionMessage = "channel.subscription.message" EventSubTypeChannelCheer = "channel.cheer" EventSubTypeChannelRaid = "channel.raid" EventSubTypeChannelBan = "channel.ban" EventSubTypeChannelUnban = "channel.unban" EventSubTypeModeratorAdd = "channel.moderator.add" EventSubTypeModeratorRemove = "channel.moderator.remove" EventSubTypeChannelPointsCustomRewardAdd = "channel.channel_points_custom_reward.add" EventSubTypeChannelPointsCustomRewardUpdate = "channel.channel_points_custom_reward.update" EventSubTypeChannelPointsCustomRewardRemove = "channel.channel_points_custom_reward.remove" EventSubTypeChannelPointsCustomRewardRedemptionAdd = "channel.channel_points_custom_reward_redemption.add" EventSubTypeChannelPointsCustomRewardRedemptionUpdate = "channel.channel_points_custom_reward_redemption.update" EventSubTypeChannelPollBegin = "channel.poll.begin" EventSubTypeChannelPollProgress = "channel.poll.progress" EventSubTypeChannelPollEnd = "channel.poll.end" EventSubTypeChannelPredictionBegin = "channel.prediction.begin" EventSubTypeChannelPredictionProgress = "channel.prediction.progress" EventSubTypeChannelPredictionLock = "channel.prediction.lock" EventSubTypeChannelPredictionEnd = "channel.prediction.end" EventSubExtensionBitsTransactionCreate = "extension.bits_transaction.create" EventSubTypeHypeTrainBegin = "channel.hype_train.begin" EventSubTypeHypeTrainProgress = "channel.hype_train.progress" EventSubTypeHypeTrainEnd = "channel.hype_train.end" EventSubTypeStreamOnline = "stream.online" EventSubTypeStreamOffline = "stream.offline" EventSubTypeUserAuthorizationRevoke = "user.authorization.revoke" EventSubTypeUserUpdate = "user.update" )
EventSub helper Variables for Types and Status
const ( // DefaultAPIBaseURL is the base URL for composing API requests. DefaultAPIBaseURL = "https://api.twitch.tv/helix" // AuthBaseURL is the base URL for composing authentication requests. AuthBaseURL = "https://id.twitch.tv/oauth2" )
Variables ¶
var ( UserFollowsRegexp = regexp.MustCompile("helix/users/follows\\?first=1(&from_id=(?P<from_id>\\d+))?(&to_id=(?P<to_id>\\d+))?>") StreamChangedRegexp = regexp.MustCompile("helix/streams\\?user_id=(?P<user_id>\\d+)>") UserChangedRegexp = regexp.MustCompile("helix/users\\?id=(?P<id>\\d+)>") GameAnalyticsRegexp = regexp.MustCompile("helix/analytics\\?game_id=(?P<game_id>\\w+)>") ExtensionAnalyticsRegexp = regexp.MustCompile("helix/analytics\\?extension_id=(?P<extension_id>\\w+)>") )
Regular expressions used for parsing webhook link headers
Functions ¶
func GetWebhookTopicValuesFromRequest ¶
func GetWebhookTopicValuesFromRequest(req *http.Request, topic WebhookTopic) map[string]string
GetWebhookTopicValuesFromRequest inspects the "Link" request header to determine if it matches against any recognised webhooks topics and returns the unique values specified in the header.
For example, say we receive a "User Follows" webhook event from Twitch. Its "Link" header value look likes the following:
<https://api.twitch.tv/helix/webhooks/hub>; rel="hub", <https://api.twitch.tv/helix/users/follows?first=1&from_id=111116&to_id=22222>; rel="self"
From which GetWebhookTopicValuesFromRequest will return a map with the values of from_id and to_id:
map[from_id:111116 to_id:22222]
This is particularly useful for webhooks events that do not have a distinguishable JSON payload, such as the "Stream Changed" down event.
Additionally, if topic is not known you can pass -1 as its value and
Types ¶
type AccessCredentials ¶
type AdDetails ¶
type AdDetails struct { Length AdLengthEnum `json:"length"` Message string `json:"message"` RetryAfter int `json:"retry_after"` }
type AdLengthEnum ¶
type AdLengthEnum int
const ( AdLen30 AdLengthEnum AdLen60 AdLen90 AdLen120 AdLen150 AdLen180 )
type AppAccessTokenResponse ¶
type AppAccessTokenResponse struct { ResponseCommon Data AccessCredentials }
type AuthorizationURLParams ¶
type BadgeVersion ¶
type Ban ¶
type Ban struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` ExpiresAt Time `json:"expires_at"` }
ExpiresAt must be parsed manually since an empty string means perma ban
type BannedUsersParams ¶
type BannedUsersParams struct { BroadcasterID string `query:"broadcaster_id"` UserID string `query:"user_id"` After string `query:"after"` Before string `query:"before"` }
BroadcasterID must match the auth tokens user_id
type BannedUsersResponse ¶
type BannedUsersResponse struct { ResponseCommon Data ManyBans }
type BitsLeaderboardParams ¶
type BitsLeaderboardResponse ¶
type BitsLeaderboardResponse struct { ResponseCommon Data ManyUserBitTotals }
type BlockUserParams ¶
type BlockUserResponse ¶
type BlockUserResponse struct {
ResponseCommon
}
type Channel ¶
type Channel struct { ID string `json:"id"` GameID string `json:"game_id"` GameName string `json:"game_name"` BroadcasterLogin string `json:"broadcaster_login"` DisplayName string `json:"display_name"` Language string `json:"broadcaster_language"` Title string `json:"title"` ThumbnailURL string `json:"thumbnail_url"` IsLive bool `json:"is_live"` StartedAt Time `json:"started_at"` TagIDs []string `json:"tag_ids"` }
Channel describes a channel from SearchChannel
type ChannelCustomReward ¶
type ChannelCustomReward struct { BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterName string `json:"broadcaster_name"` ID string `json:"id"` Title string `json:"title"` Prompt string `json:"prompt"` Cost int `json:"cost"` Image RewardImage `json:"image"` DefaultImage RewardImage `json:"default_image"` IsEnabled bool `json:"is_enabled"` IsUserInputRequired bool `json:"is_user_input_required"` MaxPerStreamSetting MaxPerStreamSettings `json:"max_per_stream_setting"` MaxPerUserPerStreamSetting MaxPerUserPerStreamSettings `json:"max_per_user_per_stream_setting"` GlobalCooldownSetting GlobalCooldownSettings `json:"global_cooldown_setting"` IsPaused bool `json:"is_paused"` IsInStock bool `json:"is_in_stock"` ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"` RedemptionsRedeemedCurrentStream int `json:"redemptions_redeemed_current_stream"` CooldownExpiresAt string `json:"cooldown_expires_at"` }
type ChannelCustomRewardResponse ¶
type ChannelCustomRewardResponse struct { ResponseCommon Data ManyChannelCustomRewards }
type ChannelCustomRewardsParams ¶
type ChannelCustomRewardsParams struct { BroadcasterID string `query:"broadcaster_id"` Title string `json:"title"` Cost int `json:"cost"` Prompt string `json:"prompt"` IsEnabled bool `json:"is_enabled"` BackgroundColor string `json:"background_color"` IsUserInputRequired bool `json:"is_user_input_required"` IsMaxPerStreamEnabled bool `json:"is_max_per_stream_enabled"` MaxPerStream int `json:"max_per_stream"` IsMaxPerUserPerStreamEnabled bool `json:"is_max_per_user_per_stream_enabled"` MaxPerUserPerStream int `json:"max_per_user_per_stream"` IsGlobalCooldownEnabled bool `json:"is_global_cooldown_enabled"` GlobalCooldownSeconds int `json:"global_cooldown_seconds"` ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"` }
type ChannelEditor ¶
type ChannelEditor struct { UserID string `json:"user_id"` UserName string `json:"user_name"` CreatedAt Time `json:"created_at"` }
ChannelEditor
type ChannelEditorsParams ¶
type ChannelEditorsParams struct {
BroadcasterID string `query:"broadcaster_id"`
}
type ChannelEditorsResponse ¶
type ChannelEditorsResponse struct { ResponseCommon Data ManyChannelEditors }
type ChannelInformation ¶
type ChannelInformation struct { BroadcasterID string `json:"broadcaster_id"` BroadcasterName string `json:"broadcaster_name"` BroadcasterLanguage string `json:"broadcaster_language"` GameID string `json:"game_id"` GameName string `json:"game_name"` Title string `json:"title"` Delay int `json:"delay"` }
type ChatBadge ¶
type ChatBadge struct { SetID string `json:"set_id"` Versions []BadgeVersion `json:"versions"` }
type CheermoteTierImages ¶
type CheermoteTierImages struct { Dark TierImageTypes `json:"dark"` Light TierImageTypes `json:"light"` }
type CheermoteTiers ¶
type Cheermotes ¶
type Cheermotes struct { Prefix string `json:"prefix"` Tiers []CheermoteTiers `json:"tiers"` Type string `json:"type"` // global_first_party, global_third_party, channel_custom, display_only, sponsored Order uint `json:"order"` LastUpdated Time `json:"last_updated"` IsCharitable bool `json:"is_charitable"` }
type CheermotesParams ¶
type CheermotesParams struct {
BroadcasterID string `query:"broadcaster_id"` // optional
}
type CheermotesResponse ¶
type CheermotesResponse struct { ResponseCommon Data ManyCheermotes }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient returns a new Twitch Helix API client. It returns an if clientID is an empty string. It is concurrency safe.
func (*Client) BlockUser ¶
func (c *Client) BlockUser(params *BlockUserParams) (*BlockUserResponse, error)
BlockUser : Blocks the specified user on behalf of the authenticated user.
Required scope: user:manage:blocked_users
func (*Client) CheckUserSubscription ¶
func (c *Client) CheckUserSubscription(params *UserSubscriptionsParams) (*UserSubscriptionResponse, error)
CheckUserSubscription Check if a specific user is subscribed to a specific channel
Required scope: user:read:subscriptions
func (*Client) CreateClip ¶
func (c *Client) CreateClip(params *CreateClipParams) (*CreateClipResponse, error)
CreateClip creates a clip programmatically. This returns both an ID and an edit URL for the new clip. Clip creation takes time. We recommend that you query Get Clip, with the clip ID that is returned here. If Get Clip returns a valid clip, your clip creation was successful. If, after 15 seconds, you still have not gotten back a valid clip from Get Clip, assume that the clip was not created and retry Create Clip.
Required scope: clips:edit
func (*Client) CreateCustomReward ¶
func (c *Client) CreateCustomReward(params *ChannelCustomRewardsParams) (*ChannelCustomRewardResponse, error)
CreateCustomReward : Creates a Custom Reward on a channel. Required scope: channel:manage:redemptions
func (*Client) CreateEntitlementsUploadURL ¶
func (c *Client) CreateEntitlementsUploadURL(manifestID, entitlementType string) (*EntitlementsUploadResponse, error)
CreateEntitlementsUploadURL return a URL where you can upload a manifest file and notify users that they have an entitlement. Entitlements are digital items that users are entitled to use. Twitch entitlements are granted to users gratis or as part of a purchase on Twitch.
func (*Client) CreateEventSubSubscription ¶
func (c *Client) CreateEventSubSubscription(payload *EventSubSubscription) (*EventSubSubscriptionsResponse, error)
Creates an EventSub subscription
func (*Client) CreateExtensionSecret ¶
func (c *Client) CreateExtensionSecret(params *ExtensionSecretCreationParams) (*ExtensionSecretCreationResponse, error)
func (*Client) CreatePoll ¶
func (c *Client) CreatePoll(params *CreatePollParams) (*PollsResponse, error)
Required scope: channel:manage:polls
func (*Client) CreatePrediction ¶
func (c *Client) CreatePrediction(params *CreatePredictionParams) (*PredictionsResponse, error)
Required scope: channel:manage:predictions
func (*Client) CreateStreamMarker ¶
func (c *Client) CreateStreamMarker(params *CreateStreamMarkerParams) (*CreateStreamMarkerResponse, error)
CreateStreamMarker creates a stream marker for a live stream at the current time. The user has to be the stream owner or an editor. Stream markers cannot be created in some cases, see: https://dev.twitch.tv/docs/api/reference/#create-stream-marker
Required Scope: user:edit:broadcast
func (*Client) DeleteCustomRewards ¶
func (c *Client) DeleteCustomRewards(params *DeleteCustomRewardsParams) (*DeleteCustomRewardsResponse, error)
DeleteCustomRewards : Deletes a Custom Rewards on a channel Required scope: channel:manage:redemptions
func (*Client) DeleteVideos ¶
func (c *Client) DeleteVideos(params *DeleteVideosParams) (*DeleteVideosResponse, error)
DeleteVideos delete one or more videos (max 5) Required scope: channel:manage:videos
func (*Client) EditChannelInformation ¶
func (c *Client) EditChannelInformation(params *EditChannelInformationParams) (*EditChannelInformationResponse, error)
func (*Client) EndPoll ¶
func (c *Client) EndPoll(params *EndPollParams) (*PollsResponse, error)
Required scope: channel:manage:polls
func (*Client) EndPrediction ¶
func (c *Client) EndPrediction(params *EndPredictionParams) (*PredictionsResponse, error)
Required scope: channel:manage:predictions
func (*Client) ExtensionCreateClaims ¶
func (c *Client) ExtensionCreateClaims( params *ExtensionCreateClaimsParams, ) ( *TwitchJWTClaims, error, )
CreateClaims will construct a claims suitable for generating a JWT token, containing necessary information required by the Twitch Helix Extension API endpoints.
func (*Client) ExtensionJWTSign ¶
func (c *Client) ExtensionJWTSign(claims *TwitchJWTClaims) (tokenString string, err error)
ExtensionJWTSign Sign the a JWT Claim to produce a base64 token.
func (*Client) ExtensionJWTVerify ¶
func (c *Client) ExtensionJWTVerify(token string) (claims *TwitchJWTClaims, err error)
ExtensionJWTVerify validates a extension client side twitch base64 token and converts it into a twitch claim type, containing relevant information.
func (*Client) FormBroadcastSendPubSubPermissions ¶
func (c *Client) FormBroadcastSendPubSubPermissions() *PubSubPermissions
FormBroadcastSendPubSubPermissions create the pubsub permissions for publishing a broadcast message type
func (*Client) FormGenericPubSubPermissions ¶
func (c *Client) FormGenericPubSubPermissions() *PubSubPermissions
FormGenericPubSubPermissions create the pubsub permissions for publishing to message for any target type
func (*Client) FormGlobalSendPubSubPermissions ¶
func (c *Client) FormGlobalSendPubSubPermissions() *PubSubPermissions
FormGlobalSendPubSubPermissions create the pubsub permissions for publishing a global targeted message
func (*Client) FormWhisperSendPubSubPermissions ¶
func (c *Client) FormWhisperSendPubSubPermissions(opaqueId string) *PubSubPermissions
FormWhisperSendPubSubPermissions create the pubsub permissions for publishing a whisper message type
func (*Client) GetAppAccessToken ¶
GetAppAccessToken returns the current app access token.
func (*Client) GetAuthorizationURL ¶
func (c *Client) GetAuthorizationURL(params *AuthorizationURLParams) string
func (*Client) GetBannedUsers ¶
func (c *Client) GetBannedUsers(params *BannedUsersParams) (*BannedUsersResponse, error)
GetBannedUsers returns all banned and timed-out users in a channel.
Required scope: moderation:read
func (*Client) GetBitsLeaderboard ¶
func (c *Client) GetBitsLeaderboard(params *BitsLeaderboardParams) (*BitsLeaderboardResponse, error)
GetBitsLeaderboard gets a ranked list of Bits leaderboard information for an authorized broadcaster.
Required Scope: bits:read
func (*Client) GetChannelChatBadges ¶
func (c *Client) GetChannelChatBadges(params *GetChatBadgeParams) (*GetChatBadgeResponse, error)
func (*Client) GetChannelEditors ¶
func (c *Client) GetChannelEditors(params *ChannelEditorsParams) (*ChannelEditorsResponse, error)
GetChannelEditors Get a list of users who have editor permissions for a specific channel Required scope: channel:read:editors
func (*Client) GetChannelEmotes ¶
func (c *Client) GetChannelEmotes(params *GetChannelEmotesParams) (*GetChannelEmotesResponse, error)
func (*Client) GetChannelInformation ¶
func (c *Client) GetChannelInformation(params *GetChannelInformationParams) (*GetChannelInformationResponse, error)
func (*Client) GetCheermotes ¶
func (c *Client) GetCheermotes(params *CheermotesParams) (*CheermotesResponse, error)
func (*Client) GetClips ¶
func (c *Client) GetClips(params *ClipsParams) (*ClipsResponse, error)
GetClips returns information about a specified clip.
func (*Client) GetCreatorGoals ¶
func (c *Client) GetCreatorGoals(payload *GetCreatorGoalsParams) (*CreatorGoalsResponse, error)
Required scope: channel:read:goals
func (*Client) GetCustomRewards ¶
func (c *Client) GetCustomRewards(params *GetCustomRewardsParams) (*ChannelCustomRewardResponse, error)
GetCustomRewards : Get Custom Rewards on a channel Required scope: channel:read:redemptions
func (*Client) GetDropsEntitlements ¶
func (c *Client) GetDropsEntitlements(params *GetDropEntitlementsParams) (*GetDropsEntitlementsResponse, error)
GetDropsEntitlements returns a list of entitlements, which have been awarded to users by your organization. Filtering by UserID returns all of the entitlements related to that specific user. Filtering by GameID returns all of the entitlements related to that game. Filtering by GameID and UserID returns all of the entitlements related to that game and that user. Filtering by FulfillmentStatus returns all of the entitlements with the specified fulfillment status. Entitlements are digital items that users are entitled to use. Twitch entitlements are granted based on viewership engagement with a content creator, based on the game developers' campaign.
func (*Client) GetEmoteSets ¶
func (c *Client) GetEmoteSets(params *GetEmoteSetsParams) (*GetEmoteSetsResponse, error)
GetEmoteSets
func (*Client) GetEntitlementCodeStatus ¶
func (c *Client) GetEntitlementCodeStatus(params *CodesParams) (*CodeResponse, error)
GetEntitlementCodeStatus Per https://dev.twitch.tv/docs/api/reference#get-code-status Access is controlled via an app access token on the calling service. The client ID associated with the app access token must be approved by Twitch as part of a contracted arrangement. Callers with an app access token are authorized to redeem codes on behalf of any Twitch user account.
func (*Client) GetEventSubSubscriptions ¶
func (c *Client) GetEventSubSubscriptions(params *EventSubSubscriptionsParams) (*EventSubSubscriptionsResponse, error)
Get all EventSub Subscriptions
func (*Client) GetExtensionAnalytics ¶
func (c *Client) GetExtensionAnalytics(params *ExtensionAnalyticsParams) (*ExtensionAnalyticsResponse, error)
GetExtensionAnalytics returns a URL to the downloadable CSV file containing analytics data. Valid for 5 minutes.
func (*Client) GetExtensionConfigurationSegment ¶
func (c *Client) GetExtensionConfigurationSegment(params *ExtensionGetConfigurationParams) (*ExtensionGetConfigurationSegmentResponse, error)
func (*Client) GetExtensionLiveChannels ¶
func (c *Client) GetExtensionLiveChannels(params *ExtensionLiveChannelsParams) (*ExtensionLiveChannelsResponse, error)
func (*Client) GetExtensionSecrets ¶
func (c *Client) GetExtensionSecrets(params *GetExtensionSecretParams) (*GetExtensionSecretResponse, error)
func (*Client) GetExtensionSignedJWTToken ¶
GetAppAccessToken returns the current app access token.
func (*Client) GetExtensionTransactions ¶
func (c *Client) GetExtensionTransactions(params *ExtensionTransactionsParams) (*ExtensionTransactionsResponse, error)
GetExtensionTransactions allows extension back end servers to fetch a list of transactions that have occurred for their extension across all of Twitch. A transaction is a record of a user exchanging Bits for an in-Extension digital good.
See https://dev.twitch.tv/docs/api/reference/#get-extension-transactions
func (*Client) GetFollowedStream ¶
func (c *Client) GetFollowedStream(params *FollowedStreamsParams) (*StreamsResponse, error)
GetFollowedStream : Gets information about active streams belonging to channels that the authenticated user follows. Streams are returned sorted by number of current viewers, in descending order. Across multiple pages of results, there may be duplicate or missing streams, as viewers join and leave streams.
Required scope: user:read:follows
func (*Client) GetGameAnalytics ¶
func (c *Client) GetGameAnalytics(params *GameAnalyticsParams) (*GameAnalyticsResponse, error)
GetGameAnalytics returns a URL to the downloadable CSV file containing analytics data for the specified game. Valid for 5 minutes.
func (*Client) GetGames ¶
func (c *Client) GetGames(params *GamesParams) (*GamesResponse, error)
func (*Client) GetGlobalChatBadges ¶
func (c *Client) GetGlobalChatBadges() (*GetChatBadgeResponse, error)
func (*Client) GetGlobalEmotes ¶
func (c *Client) GetGlobalEmotes() (*GetChannelEmotesResponse, error)
func (*Client) GetHypeTrainEvents ¶
func (c *Client) GetHypeTrainEvents(params *HypeTrainEventsParams) (*HypeTrainEventsResponse, error)
Required scope: channel:read:hype_train
func (*Client) GetPolls ¶
func (c *Client) GetPolls(params *PollsParams) (*PollsResponse, error)
Required scope: channel:read:polls
func (*Client) GetPredictions ¶
func (c *Client) GetPredictions(params *PredictionsParams) (*PredictionsResponse, error)
Required scope: channel:read:predictions
func (*Client) GetStreamKey ¶
func (c *Client) GetStreamKey(params *StreamKeyParams) (*StreamsResponse, error)
Required scope: channel:read:stream_key
func (*Client) GetStreamMarkers ¶
func (c *Client) GetStreamMarkers(params *StreamMarkersParams) (*StreamMarkersResponse, error)
GetStreamMarkers gets stream markers of a VOD or of the current live stream of an user being recorded as VOD.
Required Scope: user:read:broadcast
func (*Client) GetStreams ¶
func (c *Client) GetStreams(params *StreamsParams) (*StreamsResponse, error)
GetStreams returns a list of live channels based on the search parameters. To query offline channels, use SearchChannels.
func (*Client) GetSubscriptions ¶
func (c *Client) GetSubscriptions(params *SubscriptionsParams) (*SubscriptionsResponse, error)
GetSubscriptions gets subscriptions about one Twitch broadcaster. Broadcasters can only request their own subscriptions.
Required scope: channel:read:subscriptions
func (*Client) GetTopGames ¶
func (c *Client) GetTopGames(params *TopGamesParams) (*TopGamesResponse, error)
func (*Client) GetUserAccessToken ¶
GetUserAccessToken returns the current user access token.
func (*Client) GetUserActiveExtensions ¶
func (c *Client) GetUserActiveExtensions(params *UserActiveExtensionsParams) (*UserActiveExtensionsResponse, error)
GetUserActiveExtensions Gets information about active extensions installed by a specified user, identified by a user ID or Bearer token.
Optional scope: user:read:broadcast or user:edit:broadcast
func (*Client) GetUserExtensions ¶
func (c *Client) GetUserExtensions() (*UserExtensionsResponse, error)
GetUserExtensions gets a list of all extensions (both active and inactive) for a specified user, identified by a Bearer token
Required scope: user:read:broadcast
func (*Client) GetUsers ¶
func (c *Client) GetUsers(params *UsersParams) (*UsersResponse, error)
GetUsers gets information about one or more specified Twitch users. Users are identified by optional user IDs and/or login name. If neither a user ID nor a login name is specified, the user is looked up by Bearer token.
Optional scope: user:read:email
func (*Client) GetUsersBlocked ¶
func (c *Client) GetUsersBlocked(params *UsersBlockedParams) (*UsersBlockedResponse, error)
GetUsersBlocked : Gets a specified user’s block list.
Required scope: user:read:blocked_users
func (*Client) GetUsersFollows ¶
func (c *Client) GetUsersFollows(params *UsersFollowsParams) (*UsersFollowsResponse, error)
GetUsersFollows gets information on follow relationships between two Twitch users. Information returned is sorted in order, most recent follow first. This can return information like “who is lirik following,” “who is following lirik,” or “is user X following user Y.”
func (*Client) GetVideos ¶
func (c *Client) GetVideos(params *VideosParams) (*VideosResponse, error)
GetVideos gets video information by video ID (one or more), user ID (one only), or game ID (one only).
func (*Client) GetWebhookSubscriptions ¶
func (c *Client) GetWebhookSubscriptions(params *WebhookSubscriptionsParams) (*WebhookSubscriptionsResponse, error)
GetWebhookSubscriptions gets webhook subscriptions, in order of expiration. Requires an app access token.
func (*Client) ModerateHeldMessage ¶
func (c *Client) ModerateHeldMessage(params *HeldMessageModerationParams) (*HeldMessageModerationResponse, error)
Required scope: moderator:manage:automod
func (*Client) PostWebhookSubscription ¶
func (c *Client) PostWebhookSubscription(payload *WebhookSubscriptionPayload) (*WebhookSubscriptionResponse, error)
func (*Client) RedeemEntitlementCode ¶
func (c *Client) RedeemEntitlementCode(params *CodesParams) (*CodeResponse, error)
RedeemEntitlementCode Per https://dev.twitch.tv/docs/api/reference/#redeem-code Access is controlled via an app access token on the calling service. The client ID associated with the app access token must be approved by Twitch. Callers with an app access token are authorized to redeem codes on behalf of any Twitch user account.
func (*Client) RefreshUserAccessToken ¶
func (c *Client) RefreshUserAccessToken(refreshToken string) (*RefreshTokenResponse, error)
RefreshUserAccessToken submits a request to have the longevity of an access token extended. Twitch OAuth2 access tokens have expirations. Token-expiration periods vary in length. You should build your applications in such a way that they are resilient to token authentication failures.
func (*Client) RemoveEventSubSubscription ¶
func (c *Client) RemoveEventSubSubscription(id string) (*RemoveEventSubSubscriptionParamsResponse, error)
Remove an EventSub Subscription
func (*Client) RequestAppAccessToken ¶
func (c *Client) RequestAppAccessToken(scopes []string) (*AppAccessTokenResponse, error)
func (*Client) RequestUserAccessToken ¶
func (c *Client) RequestUserAccessToken(code string) (*UserAccessTokenResponse, error)
func (*Client) RevokeUserAccessToken ¶
func (c *Client) RevokeUserAccessToken(accessToken string) (*RevokeAccessTokenResponse, error)
RevokeUserAccessToken submits a request to Twitch to have an access token revoked.
Both successful requests and requests with bad tokens return 200 OK with no body. Requests with bad tokens return the same response, as there is no meaningful action a client can take after sending a bad token.
func (*Client) SearchChannels ¶
func (c *Client) SearchChannels(params *SearchChannelsParams) (*SearchChannelsResponse, error)
SearchChannels searches for Twitch channels based on the given search parameters. Unlike GetStreams, this can also return offline channels.
func (*Client) SendExtensionChatMessage ¶
func (c *Client) SendExtensionChatMessage(params *ExtensionSendChatMessageParams) (*ExtensionSendChatMessageResponse, error)
SendExtensionChatMessage Sends a specified chat message to a specified channel. The message will appear in the channel’s chat as a normal message, The author of the message is the Extension name.
see https://dev.twitch.tv/docs/api/reference#send-extension-chat-message
func (*Client) SendExtensionPubSubMessage ¶
func (c *Client) SendExtensionPubSubMessage(params *ExtensionSendPubSubMessageParams) (*ExtensionSendPubSubMessageResponse, error)
func (*Client) SetAppAccessToken ¶
func (*Client) SetExtensionRequiredConfiguration ¶
func (c *Client) SetExtensionRequiredConfiguration(params *ExtensionSetRequiredConfigurationParams) (*ExtensionSetRequiredConfigurationResponse, error)
func (*Client) SetExtensionSegmentConfig ¶
func (c *Client) SetExtensionSegmentConfig(params *ExtensionSetConfigurationParams) (*ExtensionSetConfigurationResponse, error)
https://dev.twitch.tv/docs/extensions/reference/#set-extension-configuration-segment
func (*Client) SetExtensionSignedJWTToken ¶
func (*Client) SetRedirectURI ¶
func (*Client) SetUserAccessToken ¶
func (*Client) SetUserAgent ¶
func (*Client) StartCommercial ¶
func (c *Client) StartCommercial(params *StartCommercialParams) (*StartCommercialResponse, error)
StartCommercial starts a commercial on a specified channel OAuth Token required Requires channel:edit:commercial scope
func (*Client) UnblockUser ¶
func (c *Client) UnblockUser(params *UnblockUserParams) (*BlockUserResponse, error)
UnblockUser : Unblocks the specified user on behalf of the authenticated user.
Required scope: user:manage:blocked_users
func (*Client) UpdateDropsEntitlements ¶
func (c *Client) UpdateDropsEntitlements(params *UpdateDropsEntitlementsParams) (*UpdateDropsEntitlementsResponse, error)
UpdateDropsEntitlements updates the fulfillment status of a set of entitlements, owned by the authenticated user or your organization. It returns a list of the entitlement ids requested, grouped by a status code used to indicate partial success. "SUCCESS" means the entitlement was successfully updated, "INVALID_ID" means invalid format for the entitlement, "NOT_FOUND" means the entitlement was not found, "UNAUTHORIZED" means entitlement is not owned by the organization or the user when called with a user OAuth token and "UPDATE_FAILED" indicates a possible transient error and the operation should be retried again later. Entitlements are digital items that users are entitled to use. Twitch entitlements are granted based on viewership engagement with a content creator, based on the game developers' campaign.
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(params *UpdateUserParams) (*UsersResponse, error)
UpdateUser updates the description of a user specified by a Bearer token.
Required scope: user:edit
func (*Client) UpdateUserExtensions ¶
func (c *Client) UpdateUserExtensions(payload *UpdateUserExtensionsPayload) (*UserActiveExtensionsResponse, error)
UpdateUserExtensions Updates the activation state, extension ID, and/or version number of installed extensions for a specified user, identified by a Bearer token. If you try to activate a given extension under multiple extension types, the last write wins (and there is no guarantee of write order).
Required scope: user:edit:broadcast
func (*Client) ValidateToken ¶
func (c *Client) ValidateToken(accessToken string) (bool, *ValidateTokenResponse, error)
ValidateToken - Validate access token
type Clip ¶
type Clip struct { ID string `json:"id"` URL string `json:"url"` EmbedURL string `json:"embed_url"` BroadcasterID string `json:"broadcaster_id"` BroadcasterName string `json:"broadcaster_name"` CreatorID string `json:"creator_id"` CreatorName string `json:"creator_name"` Duration float64 `json:"duration"` VideoID string `json:"video_id"` GameID string `json:"game_id"` Language string `json:"language"` Title string `json:"title"` ViewCount int `json:"view_count"` CreatedAt string `json:"created_at"` ThumbnailURL string `json:"thumbnail_url"` }
type ClipEditURL ¶
type ClipsParams ¶
type ClipsParams struct { // One of the below BroadcasterID string `query:"broadcaster_id"` GameID string `query:"game_id"` IDs []string `query:"id"` // Limit 100 // Optional First int `query:"first,20"` // Maximum 100 After string `query:"after"` Before string `query:"before"` StartedAt Time `query:"started_at"` EndedAt Time `query:"ended_at"` }
type ClipsResponse ¶
type ClipsResponse struct { ResponseCommon Data ManyClips }
type CodeResponse ¶
type CodeResponse struct { ResponseCommon Data ManyCodes }
type CodeStatus ¶
type CodeStatus struct { Code string `json:"code"` Status EntitlementCodeStatus `json:"status"` }
type CodesParams ¶
type CreateClipParams ¶
type CreateClipResponse ¶
type CreateClipResponse struct { ResponseCommon Data ManyClipEditURLs }
func (*CreateClipResponse) GetClipsCreationRateLimit ¶
func (ccr *CreateClipResponse) GetClipsCreationRateLimit() int
GetClipsCreationRateLimit returns the "Ratelimit-Helixclipscreation-Limit" header as an int.
func (*CreateClipResponse) GetClipsCreationRateLimitRemaining ¶
func (ccr *CreateClipResponse) GetClipsCreationRateLimitRemaining() int
GetClipsCreationRateLimitRemaining returns the "Ratelimit-Helixclipscreation-Remaining" header as an int.
type CreatePollParams ¶
type CreatePollParams struct { BroadcasterID string `json:"broadcaster_id"` Title string `json:"title"` // Maximum: 60 characters. Choices []PollChoiceParam `json:"choices"` // Minimum: 2 choices. Maximum: 5 choices. Duration int `json:"duration"` // Minimum: 15. Maximum: 1800. BitsVotingEnabled bool `json:"bits_voting_enabled"` // Default: false BitsPerVote int `json:"bits_per_vote"` // Minimum: 0. Maximum: 10000. ChannelPointsVotingEnabled bool `json:"channel_points_voting_enabled"` // Default: false ChannelPointsPerVote int `json:"channel_points_per_vote"` // Minimum: 0. Maximum: 1000000. }
type CreatePredictionParams ¶
type CreatePredictionParams struct { BroadcasterID string `json:"broadcaster_id"` Title string `json:"title"` // Maximum: 45 characters. Outcomes []PredictionChoiceParam `json:"outcomes"` // 2 choices mandatory PredictionWindow int `json:"prediction_window"` // Minimum: 1. Maximum: 1800. }
type CreateStreamMarker ¶
type CreateStreamMarkerResponse ¶
type CreateStreamMarkerResponse struct { ResponseCommon Data ManyCreateStreamMarkers }
type CreatorGoalsResponse ¶
type CreatorGoalsResponse struct { ResponseCommon Data ManyGoals }
type DeleteCustomRewardsResponse ¶
type DeleteCustomRewardsResponse struct {
ResponseCommon
}
Response for removing a custom reward
type DeleteVideosParams ¶
type DeleteVideosParams struct {
IDs []string `query:"id"` // Limit 5
}
type DeleteVideosResponse ¶
type DeleteVideosResponse struct {
ResponseCommon
}
type EditChannelInformationResponse ¶
type EditChannelInformationResponse struct {
ResponseCommon
}
type EmoteImage ¶
type EmoteWithOwner ¶
type EndPollParams ¶
type EndPredictionParams ¶
type Entitlement ¶
type Entitlement struct { ID string `json:"id"` BenefitID string `json:"benefit_id"` Timestamp Time `json:"timestamp"` UserID string `json:"user_id"` GameID string `json:"game_id"` FulfillmentStatus string `json:"fulfillment_status"` // Valid values "CLAIMED", "FULFILLED" UpdatedAt Time `json:"updated_at"` }
type EntitlementCodeStatus ¶
type EntitlementCodeStatus string
type EntitlementsUploadResponse ¶
type EntitlementsUploadResponse struct { ResponseCommon Data ManyEntitlementsUploadURLs }
type EntitlementsUploadURL ¶
type EntitlementsUploadURL struct {
URL string `json:"url"`
}
type EventSubBitVoting ¶
type EventSubChannelBanEvent ¶
type EventSubChannelBanEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` ModeratorUserID string `json:"moderator_user_id"` ModeratorUserLogin string `json:"moderator_user_login"` ModeratorUserName string `json:"moderator_user_name"` Reason string `json:"reason"` EndsAt Time `json:"ends_at"` IsPermanent bool `json:"is_permanent"` }
Data for a channel ban notification
type EventSubChannelCheerEvent ¶
type EventSubChannelCheerEvent struct { IsAnonymous bool `json:"is_anonymous"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Message string `json:"message"` Bits int `json:"bits"` }
Data for a channel cheer notification
type EventSubChannelFollowEvent ¶
type EventSubChannelFollowEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` }
Data for a channel follow notification
type EventSubChannelGoalEndEvent ¶
type EventSubChannelGoalEndEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserName string `json:"broadcaster_user_name"` BroadcasterUserLogin string `json:"broadcaster_user_login"` Type string `json:"type"` Description string `json:"description"` IsAchieved bool `json:"is_achieved"` CurrentAmount int `json:"current_amount"` TargetAmount int `json:"target_amount"` StartedAt Time `json:"started_at"` EndedAt Time `json:"ended_at"` }
type EventSubChannelGoalProgressEvent ¶
type EventSubChannelGoalProgressEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserName string `json:"broadcaster_user_name"` BroadcasterUserLogin string `json:"broadcaster_user_login"` Type string `json:"type"` Description string `json:"description"` CurrentAmount int `json:"current_amount"` TargetAmount int `json:"target_amount"` StartedAt Time `json:"started_at"` }
type EventSubChannelGoalStartEvent ¶
type EventSubChannelGoalStartEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserName string `json:"broadcaster_user_name"` BroadcasterUserLogin string `json:"broadcaster_user_login"` Type string `json:"type"` Description string `json:"description"` CurrentAmount int `json:"current_amount"` TargetAmount int `json:"target_amount"` StartedAt Time `json:"started_at"` }
type EventSubChannelPointsCustomRewardEvent ¶
type EventSubChannelPointsCustomRewardEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` IsEnabled bool `json:"is_enabled"` IsPaused bool `json:"is_paused"` IsInStock bool `json:"is_in_stock"` Title string `json:"title"` Cost int `json:"cost"` Prompt string `json:"prompt"` IsUserInputRequired bool `json:"is_user_input_required"` ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"` MaxPerStream EventSubMaxPerStream `json:"max_per_stream"` MaxPerUserPerStream EventSubMaxPerStream `json:"max_per_user_per_stream"` BackgroundColor string `json:"background_color"` Image EventSubImage `json:"image"` DefaultImage EventSubImage `json:"default_image"` GlobalCooldown EventSubGlobalCooldown `json:"global_cooldown"` CooldownExpiresAt Time `json:"cooldown_expires_at"` RedemptionsRedeemedCurrentStream int `json:"redemptions_redeemed_current_stream"` }
Data for a channel points custom reward notification
type EventSubChannelPointsCustomRewardRedemptionEvent ¶
type EventSubChannelPointsCustomRewardRedemptionEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` UserInput string `json:"user_input"` Status string `json:"status"` Reward EventSubReward `json:"reward"` RedeemedAt Time `json:"redeemed_at"` }
Data for a channel points custom reward redemption notification
type EventSubChannelPointsVoting ¶
type EventSubChannelPointsVoting = EventSubBitVoting
type EventSubChannelPollBeginEvent ¶
type EventSubChannelPollBeginEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Title string `json:"title"` Choices []PollChoice `json:"choices"` BitsVoting EventSubBitVoting `json:"bits_voting"` ChannelPointsVoting EventSubChannelPointsVoting `json:"channel_points_voting"` StartedAt Time `json:"started_at"` EndsAt Time `json:"ends_at"` }
Data for a channel poll begin event
type EventSubChannelPollEndEvent ¶
type EventSubChannelPollEndEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Title string `json:"title"` Choices []PollChoice `json:"choices"` BitsVoting EventSubBitVoting `json:"bits_voting"` ChannelPointsVoting EventSubChannelPointsVoting `json:"channel_points_voting"` Status string `json:"status"` StartedAt Time `json:"started_at"` EndedAt Time `json:"ended_at"` }
Data for a channel poll end event
type EventSubChannelPollProgressEvent ¶
type EventSubChannelPollProgressEvent = EventSubChannelPollBeginEvent
Data for a channel poll progress event, it's the same as the channel poll begin event
type EventSubChannelPredictionBeginEvent ¶
type EventSubChannelPredictionBeginEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Title string `json:"title"` Outcomes []EventSubOutcome `json:"outcomes"` StartedAt Time `json:"started_at"` LocksAt Time `json:"locks_at"` }
Data for a channel prediction begin event
type EventSubChannelPredictionEndEvent ¶
type EventSubChannelPredictionEndEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Title string `json:"title"` WinningOutcomeID string `json:"winning_outcome_id"` Outcomes []EventSubOutcome `json:"outcomes"` Status string `json:"status"` StartedAt Time `json:"started_at"` EndedAt Time `json:"eneded_at"` }
Data for a channel prediction end event
type EventSubChannelPredictionLockEvent ¶
type EventSubChannelPredictionLockEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Title string `json:"title"` WinningOutcomeID string `json:"winning_outcome_id"` Outcomes []EventSubOutcome `json:"outcomes"` Status string `json:"status"` StartedAt Time `json:"started_at"` LockedAt Time `json:"locked_at"` }
Data for a channel prediction lock event
type EventSubChannelPredictionProgressEvent ¶
type EventSubChannelPredictionProgressEvent = EventSubChannelPredictionBeginEvent
Data for a channel prediction progress event
type EventSubChannelRaidEvent ¶
type EventSubChannelRaidEvent struct { FromBroadcasterUserID string `json:"from_broadcaster_user_id"` FromBroadcasterUserLogin string `json:"from_broadcaster_user_login"` FromBroadcasterUserName string `json:"from_broadcaster_user_name"` ToBroadcasterUserID string `json:"to_broadcaster_user_id"` ToBroadcasterUserLogin string `json:"to_broadcaster_user_login"` ToBroadcasterUserName string `json:"to_broadcaster_user_name"` Viewers int `json:"viewers"` }
Data for a channel raid notification
type EventSubChannelSubscribeEvent ¶
type EventSubChannelSubscribeEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Tier string `json:"tier"` IsGift bool `json:"is_gift"` }
Data for a channel subscribe notification
type EventSubChannelSubscriptionGiftEvent ¶
type EventSubChannelSubscriptionGiftEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Total int `json:"total"` Tier string `json:"tier"` CumulativeTotal int `json:"cumulative_total"` IsAnonymous bool `json:"is_anonymous"` }
EventSubChannelSubscriptionGiftEvent
type EventSubChannelSubscriptionMessageEvent ¶
type EventSubChannelSubscriptionMessageEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Tier string `json:"tier"` Message EventSubMessage `json:"message"` CumulativeMonths int `json:"cumulative_months"` StreakMonths int `json:"streak_months"` DurationMonths int `json:"duration_months"` }
EventSubChannelSubscriptionMessageEvent
type EventSubChannelUnbanEvent ¶
type EventSubChannelUnbanEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` ModeratorUserID string `json:"moderator_user_id"` ModeratorUserLogin string `json:"moderator_user_login"` ModeratorUserName string `json:"moderator_user_name"` }
Data for a channel unban notification
type EventSubChannelUpdateEvent ¶
type EventSubChannelUpdateEvent struct { BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Title string `json:"title"` Language string `json:"language"` CategoryID string `json:"category_id"` CategoryName string `json:"category_name"` IsMature bool `json:"is_mature"` }
Data for a channel update notification
type EventSubCondition ¶
type EventSubCondition struct { BroadcasterUserID string `json:"broadcaster_user_id"` FromBroadcasterUserID string `json:"from_broadcaster_user_id"` ToBroadcasterUserID string `json:"to_broadcaster_user_id"` RewardID string `json:"reward_id"` ClientID string `json:"client_id"` ExtensionClientID string `json:"extension_client_id"` UserID string `json:"user_id"` }
Conditions for a subscription, not all are necessary and some only apply to some subscription types, see https://dev.twitch.tv/docs/eventsub/eventsub-reference
type EventSubContribution ¶
type EventSubContribution struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` Type string `json:"type"` Total int64 `json:"total"` }
This belongs to a hype train and defines a user contribution
type EventSubEmote ¶
EventSubEmote
type EventSubExtensionBitsTransactionCreateEvent ¶
type EventSubExtensionBitsTransactionCreateEvent struct { ExtensionClientID string `json:"extension_client_id"` ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` Product EventSubProduct `json:"product"` }
Data for an extension bits transaction creation
type EventSubGlobalCooldown ¶
type EventSubGlobalCooldown struct { IsEnabled bool `json:"is_enabled"` Seconds int `json:"seconds"` }
This belongs to a custom reward and defines it's cooldown
type EventSubHypeTrainBeginEvent ¶
type EventSubHypeTrainBeginEvent struct { BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Total int `json:"total"` Progress int `json:"progress"` Goal int `json:"goal"` TopContributions []EventSubContribution `json:"top_contributions"` LastContribution EventSubContribution `json:"last_contribution"` StartedAt Time `json:"started_at"` ExpiresAt Time `json:"expires_at"` }
Data for a hype train begin notification
type EventSubHypeTrainEndEvent ¶
type EventSubHypeTrainEndEvent struct { BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Level int `json:"level"` Total int `json:"total"` TopContributions []EventSubContribution `json:"top_contributions"` StartedAt Time `json:"started_at"` ExpiresAt Time `json:"expires_at"` CooldownEndsAt Time `json:"cooldown_ends_at"` }
Data for a hype train end notification
type EventSubHypeTrainProgressEvent ¶
type EventSubHypeTrainProgressEvent struct { BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Level int `json:"level"` Total int `json:"total"` Progress int `json:"progress"` Goal int `json:"goal"` TopContributions []EventSubContribution `json:"top_contributions"` LastContribution EventSubContribution `json:"last_contribution"` StartedAt Time `json:"started_at"` ExpiresAt Time `json:"expires_at"` }
Data for a hype train progress notification
type EventSubImage ¶
type EventSubImage struct { Url1x string `json:"url_1x"` Url2x string `json:"url_2x"` Url4x string `json:"url_4x"` }
This also belongs to a custom reward and defines the image urls
type EventSubMaxPerStream ¶
This belongs to a custom reward and defines if it is limited per stream
type EventSubMessage ¶
type EventSubMessage struct { Text string `json:"text"` Emotes []EventSubEmote `json:"emotes"` }
EventSubMessage
type EventSubModeratorAddEvent ¶
type EventSubModeratorAddEvent = EventSubChannelFollowEvent
Data for a channel moderator add notification, it's the same as the channel follow notification
type EventSubModeratorRemoveEvent ¶
type EventSubModeratorRemoveEvent = EventSubChannelFollowEvent
Data for a channel moderator remove notification, it's the same as the channel follow notification
type EventSubOutcome ¶
type EventSubOutcome struct { ID string `json:"id"` Title string `json:"title"` Color string `json:"color"` Users int `json:"users"` ChannelPoints int `json:"channel_points"` TopPredictors []EventSubTopPredictor `json:"top_predictors"` }
This belong to a channel prediction and defines the outcomes
type EventSubProduct ¶
type EventSubReward ¶
type EventSubReward struct { ID string `json:"id"` Title string `json:"title"` Cost int `json:"cost"` Prompt string `json:"prompt"` }
This belongs to a reward redemption and defines the reward redeemed
type EventSubStreamOfflineEvent ¶
type EventSubStreamOfflineEvent struct { BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` }
Data for a stream offline notification
type EventSubStreamOnlineEvent ¶
type EventSubStreamOnlineEvent struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_user_id"` BroadcasterUserLogin string `json:"broadcaster_user_login"` BroadcasterUserName string `json:"broadcaster_user_name"` Type string `json:"type"` StartedAt Time `json:"started_at"` }
Data for a stream online notification
type EventSubSubscription ¶
type EventSubSubscription struct { ID string `json:"id"` Type string `json:"type"` Version string `json:"version"` Status string `json:"status"` Condition EventSubCondition `json:"condition"` Transport EventSubTransport `json:"transport"` CreatedAt Time `json:"created_at"` Cost int `json:"cost"` }
Represents a subscription
type EventSubSubscriptionsParams ¶
type EventSubSubscriptionsParams struct { Status string `query:"status"` Type string `query:"type"` After string `query:"after"` }
Parameter for filtering subscriptions, currently only the status is filterable
type EventSubSubscriptionsResponse ¶
type EventSubSubscriptionsResponse struct { ResponseCommon Data ManyEventSubSubscriptions }
Response for getting all current subscriptions
type EventSubTopPredictor ¶
type EventSubTopPredictor struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` ChannelPointWon int `json:"channel_points_won"` ChannelPointsUsed int `json:"channel_points_used"` }
This belong to an outcome and defines user reward
type EventSubTransport ¶
type EventSubTransport struct { Method string `json:"method"` Callback string `json:"callback"` Secret string `json:"secret"` }
Transport for the subscription, currently the only supported Method is "webhook". Secret must be between 10 and 100 characters
type EventSubUserAuthenticationRevokeEvent ¶
type EventSubUserAuthenticationRevokeEvent struct { ClientID string `json:"client_id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` }
Data for an user authentication revoke notification, this means the user has revoked the access token and if you need to comply with gdpr you need to delete your user data belonging to the user.
type EventSubUserUpdateEvent ¶
type EventSubUserUpdateEvent struct { UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` Email string `json:"email"` Description string `json:"description"` }
Data for an user update notification
type ExtensionAnalytic ¶
type ExtensionAnalyticsResponse ¶
type ExtensionAnalyticsResponse struct { ResponseCommon Data ManyExtensionAnalytics }
type ExtensionConfigurationSegment ¶
type ExtensionConfigurationSegment struct { Segment ExtensionSegmentType `json:"segment"` Version string `json:"version"` Content string `json:"content"` }
type ExtensionCreateClaimsParams ¶
type ExtensionCreateClaimsParams struct { // ChannelID if this value is empty it will default to 'all' ChannelID string // PubSub is the pubsub permission to attach to the claim PubSub *PubSubPermissions // Expiration is the epoch of jwt expiration, default 3 minutes from time.Now Expiration int64 }
type ExtensionGetConfigurationParams ¶
type ExtensionGetConfigurationParams struct { ExtensionID string `query:"extension_id"` BroadcasterID string `query:"broadcaster_id"` Segments []ExtensionSegmentType `query:"segment"` }
type ExtensionGetConfigurationSegmentResponse ¶
type ExtensionGetConfigurationSegmentResponse struct { ResponseCommon Data ManyExtensionConfigurationSegments }
type ExtensionLiveChannel ¶
type ExtensionLiveChannelsResponse ¶
type ExtensionLiveChannelsResponse struct { ResponseCommon Data ManyExtensionLiveChannels }
type ExtensionOptions ¶
type ExtensionPubSubPublishType ¶
type ExtensionPubSubPublishType string
PublishType The Pub/Sub broadcast type
const ( ExtensionPubSubGenericPublish ExtensionPubSubPublishType = "*" ExtensionPubSubBroadcastPublish ExtensionPubSubPublishType = "broadcast" ExtensionPubSubGlobalPublish ExtensionPubSubPublishType = "global" )
Types of Pub/Sub Permissions or targets
func (ExtensionPubSubPublishType) String ¶
func (p ExtensionPubSubPublishType) String() string
type ExtensionSecretCreationResponse ¶
type ExtensionSecretCreationResponse struct { Data ManyExtensionSecrets ResponseCommon }
GetExtensionSecretResponse response structure received when generating or querying for generated secrets
type ExtensionSegmentType ¶
type ExtensionSegmentType string
SegmentType A segment configuration type
const ( ExtensionConfigrationBroadcasterSegment ExtensionSegmentType = "broadcaster" ExtensionConfigurationDeveloperSegment ExtensionSegmentType = "developer" ExtensionConfigurationGlobalSegment ExtensionSegmentType = "global" )
Types of segments datastores for the configuration service
func (ExtensionSegmentType) String ¶
func (s ExtensionSegmentType) String() string
type ExtensionSendChatMessageResponse ¶
type ExtensionSendChatMessageResponse struct {
ResponseCommon
}
type ExtensionSendPubSubMessageParams ¶
type ExtensionSendPubSubMessageParams struct { BroadcasterID string `json:"broadcaster_id"` Message string `json:"message"` Target []ExtensionPubSubPublishType `json:"target"` IsGlobalBroadcast bool `json:"is_global_broadcast"` }
type ExtensionSendPubSubMessageResponse ¶
type ExtensionSendPubSubMessageResponse struct {
ResponseCommon
}
type ExtensionSetConfigurationParams ¶
type ExtensionSetConfigurationParams struct { Segment ExtensionSegmentType `json:"segment"` ExtensionID string `json:"extension_id"` // BroadcasterID is only populated if segment is of type 'developer' || 'broadcaster' BroadcasterID string `json:"broadcaster_id,omitempty"` Version string `json:"version"` Content string `json:"content"` }
type ExtensionSetConfigurationResponse ¶
type ExtensionSetConfigurationResponse struct {
ResponseCommon
}
type ExtensionSetRequiredConfigurationParams ¶
type ExtensionSetRequiredConfigurationParams struct { BroadcasterID string `query:"broadcaster_id" json:"-"` ExtensionID string `json:"extension_id"` RequiredConfiguration string `json:"required_version"` ExtensionVersion string `json:"extension_version"` ConfigurationVersion string `json:"configuration_version"` }
type ExtensionSetRequiredConfigurationResponse ¶
type ExtensionSetRequiredConfigurationResponse struct {
ResponseCommon
}
type ExtensionTransaction ¶
type ExtensionTransaction struct { ID string `json:"id"` Timestamp Time `json:"timestamp"` BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterName string `json:"broadcaster_name"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` ProductType string `json:"product_type"` ProductData struct { Domain string `json:"domain"` Broadcast bool `json:"broadcast"` Expiration string `json:"expiration"` SKU string `json:"sku"` Cost struct { Amount int `json:"amount"` Type string `json:"type"` } `json:"cost"` DisplayName string `json:"displayName"` InDevelopment bool `json:"inDevelopment"` } `json:"product_data"` }
type ExtensionTransactionsResponse ¶
type ExtensionTransactionsResponse struct { ResponseCommon Data ManyExtensionTransactions }
type FollowedStreamsParams ¶
type GameAnalytic ¶
type GameAnalyticsParams ¶
type GameAnalyticsResponse ¶
type GameAnalyticsResponse struct { ResponseCommon Data ManyGameAnalytics }
type GamesParams ¶
type GamesResponse ¶
type GamesResponse struct { ResponseCommon Data ManyGames }
type GetChannelEmotesParams ¶
type GetChannelEmotesParams struct {
BroadcasterID string `query:"broadcaster_id"`
}
type GetChannelEmotesResponse ¶
type GetChannelEmotesResponse struct { ResponseCommon Data ManyEmotes }
type GetChannelInformationResponse ¶
type GetChannelInformationResponse struct { ResponseCommon Data ManyChannelInformation }
type GetChatBadgeParams ¶
type GetChatBadgeParams struct {
BroadcasterID string `query:"broadcaster_id"`
}
type GetChatBadgeResponse ¶
type GetChatBadgeResponse struct { ResponseCommon Data ManyChatBadge }
type GetCreatorGoalsParams ¶
type GetCreatorGoalsParams struct {
BroadcasterID string `query:"broadcaster_id"`
}
type GetCustomRewardsParams ¶
type GetDropsEntitlementsResponse ¶
type GetDropsEntitlementsResponse struct { ResponseCommon Data ManyEntitlementsWithPagination }
type GetEmoteSetsParams ¶
type GetEmoteSetsParams struct {
EmoteSetIDs []string `query:"emote_set_id"` // Minimum: 1. Maximum: 25.
}
type GetEmoteSetsResponse ¶
type GetEmoteSetsResponse struct { ResponseCommon Data ManyEmotesWithOwner }
type GetExtensionSecretParams ¶
type GetExtensionSecretParams struct {
ExtensionID string `query:"extension_id"`
}
type GetExtensionSecretResponse ¶
type GetExtensionSecretResponse struct { Data ManyExtensionSecrets ResponseCommon }
GetExtensionSecretResponse response structure received when fetching secrets for an extension
type GetPollsResponse ¶
type GetPollsResponse struct { ResponseCommon Data ManyPolls }
type GetPredictionsResponse ¶
type GetPredictionsResponse struct { ResponseCommon Data ManyPredictions }
type GlobalCooldownSettings ¶
type Goal ¶
type Goal struct { ID string `json:"id"` BroadcasterID string `json:"broadcaster_id"` BroadcasterName string `json:"broadcaster_name"` BroadcasterLogin string `json:"broadcaster_login"` Type string `json:"type"` Description string `json:"description"` CurrentAmount int `json:"current_amount"` TargetAmount int `json:"target_amount"` CreatedAt Time `json:"created_at"` }
type HeldMessageModerationResponse ¶
type HeldMessageModerationResponse struct {
ResponseCommon
}
type HypeTrainContribuition ¶
type HypeTrainEvent ¶
type HypeTrainEvent struct { ID string `json:"id"` EventType string `json:"event_type"` EventTimestamp Time `json:"event_timestamp"` Version string `json:"version"` Event HypeTrainEventData `json:"event_data"` }
type HypeTrainEventData ¶
type HypeTrainEventData struct { ID string `json:"id"` BroadcasterID string `json:"broadcaster_id"` CooldownEndTime Time `json:"cooldown_end_time"` ExpiresAt Time `json:"expires_at"` Goal int64 `json:"goal"` LastContribution HypeTrainContribuition `json:"last_contribution"` Level int64 `json:"level"` StartedAt Time `json:"started_at"` TopContributions []HypeTrainContribuition `json:"top_contributions"` Total int64 `json:"total"` }
type HypeTrainEventsParams ¶
type HypeTrainEventsResponse ¶
type HypeTrainEventsResponse struct { ResponseCommon Data ManyHypeTrainEvents }
type ManyAdDetails ¶
type ManyAdDetails struct {
AdDetails []AdDetails `json:"data"`
}
type ManyBans ¶
type ManyBans struct { Bans []Ban `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyChannelCustomRewards ¶
type ManyChannelCustomRewards struct {
ChannelCustomRewards []ChannelCustomReward `json:"data"`
}
type ManyChannelEditors ¶
type ManyChannelEditors struct {
ChannelEditors []ChannelEditor `json:"data"`
}
type ManyChannelInformation ¶
type ManyChannelInformation struct {
Channels []ChannelInformation `json:"data"`
}
type ManyChatBadge ¶
type ManyChatBadge struct {
Badges []ChatBadge `json:"data"`
}
type ManyCheermotes ¶
type ManyCheermotes struct {
Cheermotes []Cheermotes `json:"data"`
}
type ManyClipEditURLs ¶
type ManyClipEditURLs struct {
ClipEditURLs []ClipEditURL `json:"data"`
}
type ManyClips ¶
type ManyClips struct { Clips []Clip `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyCodes ¶
type ManyCodes struct {
Codes []CodeStatus `json:"data"`
}
type ManyCreateStreamMarkers ¶
type ManyCreateStreamMarkers struct {
CreateStreamMarkers []CreateStreamMarker `json:"data"`
}
type ManyEmotes ¶
type ManyEmotes struct {
Emotes []Emote `json:"data"`
}
type ManyEmotesWithOwner ¶
type ManyEmotesWithOwner struct {
Emotes []EmoteWithOwner `json:"data"`
}
type ManyEntitlements ¶
type ManyEntitlements struct {
Entitlements []Entitlement `json:"data"`
}
type ManyEntitlementsUploadURLs ¶
type ManyEntitlementsUploadURLs struct {
URLs []EntitlementsUploadURL `json:"data"`
}
type ManyEntitlementsWithPagination ¶
type ManyEntitlementsWithPagination struct { ManyEntitlements Pagination `json:"pagination"` }
type ManyEventSubSubscriptions ¶
type ManyEventSubSubscriptions struct { Total int `json:"total"` TotalCost int `json:"total_cost"` MaxTotalCost int `json:"max_total_cost"` EventSubSubscriptions []EventSubSubscription `json:"data"` Pagination Pagination `json:"pagination"` }
Twitch Response for getting all current subscriptions
type ManyExtensionAnalytics ¶
type ManyExtensionAnalytics struct { ExtensionAnalytics []ExtensionAnalytic `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyExtensionConfigurationSegments ¶
type ManyExtensionConfigurationSegments struct {
Segments []ExtensionConfigurationSegment `json:"data"`
}
type ManyExtensionLiveChannels ¶
type ManyExtensionLiveChannels struct { LiveChannels []ExtensionLiveChannel `json:"data"` Pagination string `json:"pagination"` }
type ManyExtensionSecrets ¶
type ManyExtensionSecrets struct {
SecretInfo []SecretsInformation `json:"data"`
}
type ManyExtensionTransactions ¶
type ManyExtensionTransactions struct { ExtensionTransactions []ExtensionTransaction `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyFollows ¶
type ManyFollows struct { Total int `json:"total"` Follows []UserFollow `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyGameAnalytics ¶
type ManyGameAnalytics struct { GameAnalytics []GameAnalytic `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyGamesWithPagination ¶
type ManyGamesWithPagination struct { ManyGames Pagination Pagination `json:"pagination"` }
type ManyGoals ¶
type ManyGoals struct { Goals []Goal `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyHypeTrainEvents ¶
type ManyHypeTrainEvents struct { Events []HypeTrainEvent `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyPolls ¶
type ManyPolls struct { Polls []Poll `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyPredictions ¶
type ManyPredictions struct { Predictions []Prediction `json:"data"` Pagination Pagination `json:"pagination"` }
type ManySearchChannels ¶
type ManySearchChannels struct { Channels []Channel `json:"data"` Pagination Pagination `json:"pagination"` }
ManySearchChannels is the response data from SearchChannels
type ManyStreamMarkers ¶
type ManyStreamMarkers struct { StreamMarkers []StreamMarker `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyStreams ¶
type ManyStreams struct { Streams []Stream `json:"data"` Pagination Pagination `json:"pagination"` }
type ManySubscriptions ¶
type ManySubscriptions struct { Subscriptions []Subscription `json:"data"` Pagination Pagination `json:"pagination"` Total int `json:"total"` Points int `json:"points"` // Each Tier 1 is worth 1, Tier 2 is worth 2, and Tier 3 is worth 6 }
type ManyUpdatedEntitlementSet ¶
type ManyUpdatedEntitlementSet struct {
EntitlementSets []UpdatedEntitlementSet `json:"data"`
}
type ManyUserBitTotals ¶
type ManyUserBitTotals struct { Total int `json:"total"` DateRange DateRange `json:"date_range"` UserBitTotals []UserBitTotal `json:"data"` }
type ManyUserExtensions ¶
type ManyUserExtensions struct {
UserExtensions []UserExtension `json:"data"`
}
type ManyUserSubscriptions ¶
type ManyUserSubscriptions struct {
UserSubscriptions []UserSubscription `json:"data"`
}
type ManyUsersBlocked ¶
type ManyUsersBlocked struct { Users []UserBlocked `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyVideos ¶
type ManyVideos struct { Videos []Video `json:"data"` Pagination Pagination `json:"pagination"` }
type ManyWebhookSubscriptions ¶
type ManyWebhookSubscriptions struct { Total int `json:"total"` WebhookSubscriptions []WebhookSubscription `json:"data"` Pagination Pagination `json:"pagination"` }
type MaxPerStreamSettings ¶
type Options ¶
type Options struct { ClientID string ClientSecret string AppAccessToken string UserAccessToken string UserAgent string RedirectURI string HTTPClient HTTPClient RateLimitFunc RateLimitFunc APIBaseURL string ExtensionOpts ExtensionOptions }
type Pagination ¶
type Pagination struct {
Cursor string `json:"cursor"`
}
type Poll ¶
type Poll struct { ID string `json:"id"` BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterName string `json:"broadcaster_name"` Title string `json:"title"` Choices []PollChoice `json:"choices"` BitsVotingEnabled bool `json:"bits_voting_enabled"` BitsPerVote int `json:"bits_per_vote"` ChannelPointsVotingEnabled bool `json:"channel_points_voting_enabled"` ChannelPointsPerVote int `json:"channel_points_per_vote"` Status string `json:"status"` Duration int `json:"duration"` StartedAt Time `json:"started_at"` EndedAt Time `json:"ended_at"` }
type PollChoice ¶
type PollChoiceParam ¶
type PollChoiceParam struct {
Title string `json:"title"` // Maximum: 25 characters.
}
type PollsParams ¶
type PollsResponse ¶
type PollsResponse struct { ResponseCommon Data ManyPolls }
type Prediction ¶
type Prediction struct { ID string `json:"id"` BroadcasterUserID string `json:"broadcaster_id"` BroadcasterUserLogin string `json:"broadcaster_login"` BroadcasterUserName string `json:"broadcaster_name"` Title string `json:"title"` WinningOutcomeID string `json:"winning_outcome_id"` Outcomes []Outcomes `json:"outcomes"` PredictionWindow int `json:"prediction_window"` Status string `json:"status"` CreatedAt Time `json:"created_at"` EndedAt Time `json:"ended_at"` LockedAt Time `json:"locked_at"` }
Prediction ... same struct as Poll
type PredictionChoiceParam ¶
type PredictionChoiceParam struct {
Title string `json:"title"` // Maximum: 25 characters.
}
type PredictionsParams ¶
type PredictionsResponse ¶
type PredictionsResponse struct { ResponseCommon Data ManyPredictions }
type PubSubPermissions ¶
type PubSubPermissions struct { Send []ExtensionPubSubPublishType `json:"send,omitempty"` Listen []ExtensionPubSubPublishType `json:"listen,omitempty"` }
PubSubPermissions publish permissions used within JWT claims
type RateLimitFunc ¶
type RefreshTokenResponse ¶
type RefreshTokenResponse struct { ResponseCommon Data AccessCredentials }
type RemoveEventSubSubscriptionParams ¶
type RemoveEventSubSubscriptionParams struct {
ID string `query:"id"`
}
Parameter for removing a subscription.
type RemoveEventSubSubscriptionParamsResponse ¶
type RemoveEventSubSubscriptionParamsResponse struct {
ResponseCommon
}
Response for removing a subscription
type Response ¶
type Response struct { ResponseCommon Data interface{} }
func (*Response) HydrateResponseCommon ¶
func (r *Response) HydrateResponseCommon(rc *ResponseCommon)
HydrateResponseCommon copies the content of the source response's ResponseCommon to the supplied ResponseCommon argument
type ResponseCommon ¶
type ResponseCommon struct { StatusCode int Header http.Header Error string `json:"error"` ErrorStatus int `json:"status"` ErrorMessage string `json:"message"` }
func (*ResponseCommon) GetRateLimit ¶
func (rc *ResponseCommon) GetRateLimit() int
GetRateLimit returns the "RateLimit-Limit" header as an int.
func (*ResponseCommon) GetRateLimitRemaining ¶
func (rc *ResponseCommon) GetRateLimitRemaining() int
GetRateLimitRemaining returns the "RateLimit-Remaining" header as an int.
func (*ResponseCommon) GetRateLimitReset ¶
func (rc *ResponseCommon) GetRateLimitReset() int
GetRateLimitReset returns the "RateLimit-Reset" header as an int.
type RevokeAccessTokenResponse ¶
type RevokeAccessTokenResponse struct {
ResponseCommon
}
type RewardImage ¶
type SearchChannelsParams ¶
type SearchChannelsParams struct { Channel string `query:"query"` After string `query:"after"` First int `query:"first,20"` // Limit 100 LiveOnly bool `query:"live_only"` }
SearchChannelsParams is parameters for SearchChannels
type SearchChannelsResponse ¶
type SearchChannelsResponse struct { ResponseCommon Data ManySearchChannels }
SearchChannelsResponse is the response from SearchChannels
type Secret ¶
type Secret struct { ActiveAt Time `json:"active_at"` Content string `json:"content"` Expires Time `json:"expires_at"` }
Secret information about a generated secret
type SecretsInformation ¶
type StartCommercialParams ¶
type StartCommercialParams struct { BroadcasterID string `query:"broadcaster_id"` Length AdLengthEnum `query:"length"` }
type StartCommercialResponse ¶
type StartCommercialResponse struct { ResponseCommon Data ManyAdDetails }
type Stream ¶
type Stream struct { ID string `json:"id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` GameID string `json:"game_id"` GameName string `json:"game_name"` TagIDs []string `json:"tag_ids"` IsMature bool `json:"is_mature"` Type string `json:"type"` Title string `json:"title"` ViewerCount int `json:"viewer_count"` StartedAt time.Time `json:"started_at"` Language string `json:"language"` ThumbnailURL string `json:"thumbnail_url"` StreamKey string `json:"stream_key"` }
type StreamKeyParams ¶
type StreamKeyParams struct {
BroadcasterID string `query:"broadcaster_id"`
}
type StreamMarker ¶
type StreamMarker struct { UserID string `json:"user_id"` UserName string `json:"user_name"` UserLogin string `json:"user_login"` Videos []VideoMarker `json:"videos"` }
type StreamMarkersParams ¶
type StreamMarkersParams struct { UserID string `query:"user_id"` VideoID string `query:"video_id"` // Optional After string `query:"after"` Before string `query:"before"` First int `query:"first,20"` // Limit 100 }
StreamMarkersParams requires _either_ UserID or VideoID set
UserID: fetches stream markers of the current livestream of the given user (VOD recording must be enabled). VideoID: fetches streams markers of the VOD.
type StreamMarkersResponse ¶
type StreamMarkersResponse struct { ResponseCommon Data ManyStreamMarkers }
type StreamsParams ¶
type StreamsParams struct { After string `query:"after"` Before string `query:"before"` First int `query:"first,20"` // Limit 100 GameIDs []string `query:"game_id"` // Limit 100 Language []string `query:"language"` // Limit 100 Type string `query:"type,all"` // "all" (default), "live" and "vodcast" UserIDs []string `query:"user_id"` // limit 100 UserLogins []string `query:"user_login"` // limit 100 }
type StreamsResponse ¶
type StreamsResponse struct { ResponseCommon Data ManyStreams }
type Subscription ¶
type Subscription struct { BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterName string `json:"broadcaster_name"` IsGift bool `json:"is_gift"` GifterID string `json:"gifter_id"` GifterLogin string `json:"gifter_login"` GifterName string `json:"gifter_name"` Tier string `json:"tier"` PlanName string `json:"plan_name"` UserID string `json:"user_id"` UserName string `json:"user_name"` UserLogin string `json:"user_login"` }
type SubscriptionsParams ¶
type SubscriptionsResponse ¶
type SubscriptionsResponse struct { ResponseCommon Data ManySubscriptions }
type TierImageTypes ¶
type TierImageTypes struct { Animated TierImages `json:"animated"` Static TierImages `json:"static"` }
type TierImages ¶
type Time ¶
Time is our custom time struct.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON is our custom datetime unmarshaller. Twitch sometimes returns datetimes as empty strings, which casuses issues with the native time UnmarshalJSON method when decoding the JSON string. Here we handle that scenario, by returning a zero time value for any JSON time field that is either an empty string or "null".
type TopGamesParams ¶
type TopGamesResponse ¶
type TopGamesResponse struct { ResponseCommon Data ManyGamesWithPagination }
type TopPredictor ¶
type TwitchJWTClaims ¶
type TwitchJWTClaims struct { OpaqueUserID string `json:"opaque_user_id,omitempty"` UserID string `json:"user_id"` ChannelID string `json:"channel_id,omitempty"` Role RoleType `json:"role"` Unlinked bool `json:"is_unlinked,omitempty"` Permissions *PubSubPermissions `json:"pubsub_perms"` jwt.StandardClaims }
TwitchJWTClaims contains information containing twitch specific JWT information.
type UnblockUserParams ¶
type UnblockUserParams struct {
TargetUserID string `query:"target_user_id"`
}
type UpdateDropsEntitlementsResponse ¶
type UpdateDropsEntitlementsResponse struct { ResponseCommon Data ManyUpdatedEntitlementSet }
type UpdateUserExtensionsPayload ¶
type UpdateUserExtensionsPayload struct { Component map[string]UserActiveExtensionInfo `json:"component,omitempty"` Overlay map[string]UserActiveExtensionInfo `json:"overlay,omitempty"` Panel map[string]UserActiveExtensionInfo `json:"panel,omitempty"` }
type UpdateUserParams ¶
type UpdateUserParams struct {
Description string `query:"description"`
}
type UpdatedEntitlementSet ¶
type User ¶
type User struct { ID string `json:"id"` Login string `json:"login"` DisplayName string `json:"display_name"` Type string `json:"type"` BroadcasterType string `json:"broadcaster_type"` Description string `json:"description"` ProfileImageURL string `json:"profile_image_url"` OfflineImageURL string `json:"offline_image_url"` ViewCount int `json:"view_count"` Email string `json:"email"` CreatedAt Time `json:"created_at"` }
type UserAccessTokenResponse ¶
type UserAccessTokenResponse struct { ResponseCommon Data AccessCredentials }
type UserActiveExtension ¶
type UserActiveExtension struct { Component map[string]UserActiveExtensionInfo `json:"component"` Overlay map[string]UserActiveExtensionInfo `json:"overlay"` Panel map[string]UserActiveExtensionInfo `json:"panel"` }
type UserActiveExtensionInfo ¶
type UserActiveExtensionSet ¶
type UserActiveExtensionSet struct {
UserActiveExtensions UserActiveExtension `json:"data"`
}
type UserActiveExtensionsParams ¶
type UserActiveExtensionsParams struct {
UserID string `query:"user_id"` // Optional, limit 1
}
type UserActiveExtensionsResponse ¶
type UserActiveExtensionsResponse struct { ResponseCommon Data UserActiveExtensionSet }
type UserBitTotal ¶
type UserBlocked ¶
type UserExtension ¶
type UserExtensionsResponse ¶
type UserExtensionsResponse struct { ResponseCommon Data ManyUserExtensions }
type UserFollow ¶
type UserSubscription ¶
type UserSubscription struct { BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterName string `json:"broadcaster_name"` IsGift bool `json:"is_gift"` GifterLogin string `json:"gifter_login"` GifterName string `json:"gifter_name"` Tier string `json:"tier"` }
type UserSubscriptionResponse ¶
type UserSubscriptionResponse struct { ResponseCommon Data ManyUserSubscriptions }
type UserSubscriptionsParams ¶
type UsersBlockedParams ¶
type UsersBlockedResponse ¶
type UsersBlockedResponse struct { ResponseCommon Data ManyUsersBlocked }
type UsersFollowsParams ¶
type UsersFollowsResponse ¶
type UsersFollowsResponse struct { ResponseCommon Data ManyFollows }
type UsersParams ¶
type UsersResponse ¶
type UsersResponse struct { ResponseCommon Data ManyUsers }
type ValidateTokenResponse ¶
type ValidateTokenResponse struct { ResponseCommon Data validateTokenDetails }
type Video ¶
type Video struct { ID string `json:"id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` StreamID string `json:"stream_id"` Title string `json:"title"` Description string `json:"description"` CreatedAt string `json:"created_at"` PublishedAt string `json:"published_at"` URL string `json:"url"` ThumbnailURL string `json:"thumbnail_url"` Viewable string `json:"viewable"` ViewCount int `json:"view_count"` Language string `json:"language"` Type string `json:"type"` Duration string `json:"duration"` MutedSegments []VideoMutedSegment `json:"muted_segments"` }
type VideoMarker ¶
type VideoMutedSegment ¶
type VideosParams ¶
type VideosParams struct { IDs []string `query:"id"` // Limit 100 UserID string `query:"user_id"` // Limit 1 GameID string `query:"game_id"` // Limit 1 // Optional After string `query:"after"` Before string `query:"before"` First int `query:"first,20"` // Limit 100 Language string `query:"language"` // Limit 1 Period string `query:"period,all"` // "all" (default), "day", "month", and "week" Sort string `query:"sort,time"` // "time" (default), "trending", and "views" Type string `query:"type,all"` // "all" (default), "upload", "archive", and "highlight" }
type VideosResponse ¶
type VideosResponse struct { ResponseCommon Data ManyVideos }
type WebhookSubscription ¶
type WebhookSubscriptionResponse ¶
type WebhookSubscriptionResponse struct {
ResponseCommon
}
type WebhookSubscriptionsResponse ¶
type WebhookSubscriptionsResponse struct { ResponseCommon Data ManyWebhookSubscriptions }
type WebhookTopic ¶
type WebhookTopic int
WebhookTopic is a topic that relates to a specific webhook event.
const ( UserFollowsTopic WebhookTopic = iota StreamChangedTopic UserChangedTopic GameAnalyticsTopic ExtensionAnalyticsTopic )
Enumerated webhook topics
func GetWebhookTopicFromRequest ¶
func GetWebhookTopicFromRequest(req *http.Request) WebhookTopic
GetWebhookTopicFromRequest inspects the "Link" request header to determine if it matches against any recognised webhooks topics. The matched topic is returned. Otherwise -1 is returned.
Source Files
¶
- ads.go
- analytics.go
- authentication.go
- bits.go
- channels.go
- channels_editors.go
- channels_points.go
- chat.go
- clips.go
- drops.go
- entitlement_codes.go
- entitlement_grants.go
- eventsub.go
- extension_configuration.go
- extension_jwt.go
- extension_pubsub.go
- extension_secrets.go
- extensions.go
- games.go
- goals.go
- helix.go
- hype_train.go
- moderation.go
- moderation_automod.go
- polls.go
- predictions.go
- stream_markers.go
- streams.go
- subscriptions.go
- time.go
- user_extensions.go
- users.go
- videos.go
- webhooks.go