twitch

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAuthProvided     = errors.New("one of app secret or user access token needs to be provided")
	ErrNoUserAccess       = errors.New("user endpoint called when no token was provided")
	ErrUserRefreshToken   = errors.New("the provided user refresh token is empty")
	ErrNoRefresher        = errors.New("refresher was not provided")
	ErrNoClientSecret     = errors.New("no app access token was provided")
	ErrAppTokenStatusCode = errors.New("invalid status code response while creating app access token")
)
View Source
var (
	// ErrZeroLengthMessage is returned when parsing if the input is
	// zero-length.
	ErrZeroLengthMessage = errors.New("irc: cannot parse zero-length message")

	// ErrMissingDataAfterPrefix is returned when parsing if there is
	// no message data after the prefix.
	ErrMissingDataAfterPrefix = errors.New("irc: no message data after prefix")

	// ErrMissingDataAfterTags is returned when parsing if there is no
	// message data after the tags.
	ErrMissingDataAfterTags = errors.New("irc: no message data after tags")

	// ErrMissingCommand is returned when parsing if there is no
	// command in the parsed message.
	ErrMissingCommand = errors.New("irc: missing message command")

	ErrUnhandledCommand = errors.New("irc: message command not handled by parser")
)

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(clientID string, opts ...APIOptionFunc) (*API, error)

func (*API) BanUser added in v0.0.2

func (a *API) BanUser(ctx context.Context, broadcasterID string, moderatorID string, data BanUserData) error

func (*API) CreateClip added in v0.5.1

func (a *API) CreateClip(ctx context.Context, broadcastID string, hasDelay bool) (CreatedClip, error)

func (*API) CreateEventSubSubscription added in v0.3.0

func (a *API) CreateEventSubSubscription(ctx context.Context, reqData CreateEventSubSubscriptionRequest) (CreateEventSubSubscriptionResponse, error)

func (*API) CreateStreamMarker added in v0.5.1

func (a *API) CreateStreamMarker(ctx context.Context, req CreateStreamMarkerRequest) (StreamMarker, error)

func (*API) DeleteMessage added in v0.6.0

func (a *API) DeleteMessage(ctx context.Context, broadcasterID string, moderatorID string, messageID string) error

func (*API) DeleteSubSubscriptions added in v0.3.0

func (a *API) DeleteSubSubscriptions(ctx context.Context, id string) error

func (*API) FetchAllUserEmotes added in v0.5.1

func (a *API) FetchAllUserEmotes(ctx context.Context, userID string, broadcasterID string) ([]UserEmoteImage, string, error)

func (*API) FetchEventSubSubscriptions added in v0.3.0

func (a *API) FetchEventSubSubscriptions(ctx context.Context, status, subType, userID string) ([]EventSubData, error)

https://dev.twitch.tv/docs/api/reference/#get-eventsub-subscriptions

func (*API) FetchUnbanRequests added in v0.0.4

func (a *API) FetchUnbanRequests(ctx context.Context, broadcasterID, moderatorID string) ([]UnbanRequest, error)

func (*API) FetchUserFollowedChannels added in v0.2.0

func (a *API) FetchUserFollowedChannels(ctx context.Context, userID string, broadcasterID string) ([]FollowedChannel, error)

func (*API) GetChannelChatBadges added in v0.5.3

func (a *API) GetChannelChatBadges(ctx context.Context, broadcasterID string) ([]ChannelChatBadges, error)

func (*API) GetChannelEmotes

func (a *API) GetChannelEmotes(ctx context.Context, broadcaster string) (EmoteResponse, error)

func (*API) GetChatSettings

func (a *API) GetChatSettings(ctx context.Context, broadcasterID string, moderatorID string) (GetChatSettingsResponse, error)

moderatorID needs to match ID of the user the token was generated for

func (*API) GetGlobalEmotes

func (a *API) GetGlobalEmotes(ctx context.Context) (EmoteResponse, error)

func (*API) GetStreamInfo

func (a *API) GetStreamInfo(ctx context.Context, broadcastID []string) (GetStreamsResponse, error)

func (*API) GetUserChatColor added in v0.5.3

func (a *API) GetUserChatColor(ctx context.Context, userIDs []string) ([]UserChatColor, error)

func (*API) GetUsers

func (a *API) GetUsers(ctx context.Context, logins []string, ids []string) (UserResponse, error)

func (*API) ResolveBanRequest added in v0.0.4

func (a *API) ResolveBanRequest(ctx context.Context, broadcasterID, moderatorID, requestID, status string) (UnbanRequest, error)

func (*API) SendChatAnnouncement added in v0.5.1

func (a *API) SendChatAnnouncement(ctx context.Context, broadcasterID string, moderatorID string, req CreateChatAnnouncementRequest) error

func (*API) SendChatMessage added in v0.6.0

func (a *API) SendChatMessage(ctx context.Context, data SendChatMessageRequest) (SendChatMessageResponse, error)

func (*API) UnbanUser added in v0.0.4

func (a *API) UnbanUser(ctx context.Context, broadcasterID string, moderatorID string, userID string) error

type APIError

type APIError struct {
	ErrorText string `json:"error"`
	Status    int    `json:"status"`
	Message   string `json:"message"`
}

error response

func (APIError) Error

func (a APIError) Error() string

type APIOptionFunc

type APIOptionFunc func(api *API) error

func WithClientSecret

func WithClientSecret(secret string) APIOptionFunc

func WithHTTPClient

func WithHTTPClient(client *http.Client) APIOptionFunc

func WithUserAuthentication

func WithUserAuthentication(provider AccountProvider, refresher TokenRefresher, accountID string) APIOptionFunc

type AccountProvider

type AccountProvider interface {
	GetAccountBy(id string) (save.Account, error)
	UpdateTokensFor(id, accessToken, refreshToken string) error
}

type BanUserData added in v0.0.2

type BanUserData struct {
	UserID            string `json:"user_id"`
	DurationInSeconds int    `json:"duration,omitempty"`
	Reason            string `json:"reason"`
}

func (BanUserData) MarshalEasyJSON added in v0.5.0

func (v BanUserData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BanUserData) MarshalJSON added in v0.5.0

func (v BanUserData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BanUserData) UnmarshalEasyJSON added in v0.5.0

func (v *BanUserData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BanUserData) UnmarshalJSON added in v0.5.0

func (v *BanUserData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type BanUserRequest added in v0.0.2

type BanUserRequest struct {
	Data BanUserData `json:"data"`
}

func (BanUserRequest) MarshalEasyJSON added in v0.5.0

func (v BanUserRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BanUserRequest) MarshalJSON added in v0.5.0

func (v BanUserRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BanUserRequest) UnmarshalEasyJSON added in v0.5.0

func (v *BanUserRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BanUserRequest) UnmarshalJSON added in v0.5.0

func (v *BanUserRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ChannelChatBadgeVersion added in v0.5.3

type ChannelChatBadgeVersion struct {
	ID           string `json:"id"`
	Image_URL_1x string `json:"image_url_1x"`
	Image_URL_2x string `json:"image_url_2x"`
	Image_URL_4x string `json:"image_url_4x"`
	Title        string `json:"title"`
	Description  string `json:"description"`
	ClickAction  string `json:"click_action"`
	ClickURL     string `json:"click_url"`
}

func (ChannelChatBadgeVersion) MarshalEasyJSON added in v0.5.3

func (v ChannelChatBadgeVersion) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ChannelChatBadgeVersion) MarshalJSON added in v0.5.3

func (v ChannelChatBadgeVersion) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ChannelChatBadgeVersion) UnmarshalEasyJSON added in v0.5.3

func (v *ChannelChatBadgeVersion) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ChannelChatBadgeVersion) UnmarshalJSON added in v0.5.3

func (v *ChannelChatBadgeVersion) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ChannelChatBadges added in v0.5.3

type ChannelChatBadges struct {
	SetID    string                    `json:"set_id"`
	Versions []ChannelChatBadgeVersion `json:"versions"`
}

func (ChannelChatBadges) MarshalEasyJSON added in v0.5.3

func (v ChannelChatBadges) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ChannelChatBadges) MarshalJSON added in v0.5.3

func (v ChannelChatBadges) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ChannelChatBadges) UnmarshalEasyJSON added in v0.5.3

func (v *ChannelChatBadges) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ChannelChatBadges) UnmarshalJSON added in v0.5.3

func (v *ChannelChatBadges) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Chat

type Chat struct {
	// contains filtered or unexported fields
}

func NewChat

func NewChat(logger zerolog.Logger, accountProvider AccountProvider, accountID string) *Chat

func (*Chat) ConnectWithRetry

func (c *Chat) ConnectWithRetry(ctx context.Context, messages <-chan IRCer) (<-chan IRCer, <-chan error)

type ChatAnnouncementColor added in v0.5.1

type ChatAnnouncementColor string
const (
	ChatAnnouncementColorBlue    ChatAnnouncementColor = "blue"
	ChatAnnouncementColorGreen   ChatAnnouncementColor = "green"
	ChatAnnouncementColorOrange  ChatAnnouncementColor = "orange"
	ChatAnnouncementColorPurple  ChatAnnouncementColor = "purple"
	ChatAnnouncementColorPrimary ChatAnnouncementColor = "primary"
)

type ChatSettingData

type ChatSettingData struct {
	BroadcasterID                 string `json:"broadcaster_id"`
	SlowMode                      bool   `json:"slow_mode"`
	SlowModeWaitTime              int    `json:"slow_mode_wait_time"` // in seconds
	FollowerMode                  bool   `json:"follower_mode"`
	FollowerModeDuration          int    `json:"follower_mode_duration"` // in minutes
	SubscriberMode                bool   `json:"subscriber_mode"`
	EmoteMode                     bool   `json:"emote_mode"`
	UniqueChatMode                bool   `json:"unique_chat_mode"`
	NonModeratorChatDelay         bool   `json:"non_moderator_chat_delay"`
	NonModeratorChatDelayDuration int    `json:"non_moderator_chat_delay_duration"` // in seconds
}

func (ChatSettingData) MarshalEasyJSON added in v0.5.0

func (v ChatSettingData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ChatSettingData) MarshalJSON added in v0.5.0

func (v ChatSettingData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ChatSettingData) UnmarshalEasyJSON added in v0.5.0

func (v *ChatSettingData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ChatSettingData) UnmarshalJSON added in v0.5.0

func (v *ChatSettingData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateChatAnnouncementRequest added in v0.5.1

type CreateChatAnnouncementRequest struct {
	Message string                `json:"message"`
	Color   ChatAnnouncementColor `json:"color"`
}

https://dev.twitch.tv/docs/api/reference/#send-chat-announcement

type CreateClipResponse added in v0.5.1

type CreateClipResponse struct {
	Data []CreatedClip `json:"data"`
}

func (CreateClipResponse) MarshalEasyJSON added in v0.5.1

func (v CreateClipResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateClipResponse) MarshalJSON added in v0.5.1

func (v CreateClipResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateClipResponse) UnmarshalEasyJSON added in v0.5.1

func (v *CreateClipResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateClipResponse) UnmarshalJSON added in v0.5.1

func (v *CreateClipResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateEventSubSubscriptionRequest added in v0.3.0

type CreateEventSubSubscriptionRequest struct {
	Type      string                   `json:"type"`
	Version   string                   `json:"version"`
	Condition map[string]string        `json:"condition"`
	Transport EventSubTransportRequest `json:"transport"`
}

func (CreateEventSubSubscriptionRequest) MarshalEasyJSON added in v0.5.0

func (v CreateEventSubSubscriptionRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateEventSubSubscriptionRequest) MarshalJSON added in v0.5.0

func (v CreateEventSubSubscriptionRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateEventSubSubscriptionRequest) UnmarshalEasyJSON added in v0.5.0

func (v *CreateEventSubSubscriptionRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateEventSubSubscriptionRequest) UnmarshalJSON added in v0.5.0

func (v *CreateEventSubSubscriptionRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateEventSubSubscriptionResponse added in v0.3.0

type CreateEventSubSubscriptionResponse struct {
	Data         []EventSubData `json:"data"`
	Total        int            `json:"total"`
	TotalCost    int            `json:"total_cost"`
	MaxTotalCost int            `json:"max_total_cost"`
}

func (CreateEventSubSubscriptionResponse) MarshalEasyJSON added in v0.5.0

func (v CreateEventSubSubscriptionResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateEventSubSubscriptionResponse) MarshalJSON added in v0.5.0

func (v CreateEventSubSubscriptionResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateEventSubSubscriptionResponse) UnmarshalEasyJSON added in v0.5.0

func (v *CreateEventSubSubscriptionResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateEventSubSubscriptionResponse) UnmarshalJSON added in v0.5.0

func (v *CreateEventSubSubscriptionResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateStreamMarkerRequest added in v0.5.1

type CreateStreamMarkerRequest struct {
	UserID string `json:"user_id"`
	// optional
	Description string `json:"description,omitempty"`
}

func (CreateStreamMarkerRequest) MarshalEasyJSON added in v0.5.1

func (v CreateStreamMarkerRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateStreamMarkerRequest) MarshalJSON added in v0.5.1

func (v CreateStreamMarkerRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateStreamMarkerRequest) UnmarshalEasyJSON added in v0.5.1

func (v *CreateStreamMarkerRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateStreamMarkerRequest) UnmarshalJSON added in v0.5.1

func (v *CreateStreamMarkerRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreateStreamMarkerResponse added in v0.5.1

type CreateStreamMarkerResponse struct {
	Data []StreamMarker `json:"data"`
}

func (CreateStreamMarkerResponse) MarshalEasyJSON added in v0.5.1

func (v CreateStreamMarkerResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateStreamMarkerResponse) MarshalJSON added in v0.5.1

func (v CreateStreamMarkerResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateStreamMarkerResponse) UnmarshalEasyJSON added in v0.5.1

func (v *CreateStreamMarkerResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateStreamMarkerResponse) UnmarshalJSON added in v0.5.1

func (v *CreateStreamMarkerResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CreatedClip added in v0.5.1

type CreatedClip struct {
	ID      string `json:"id"`
	EditURL string `json:"edit_url"`
}

func (CreatedClip) MarshalEasyJSON added in v0.5.1

func (v CreatedClip) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreatedClip) MarshalJSON added in v0.5.1

func (v CreatedClip) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreatedClip) UnmarshalEasyJSON added in v0.5.1

func (v *CreatedClip) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreatedClip) UnmarshalJSON added in v0.5.1

func (v *CreatedClip) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DropReason added in v0.6.0

type DropReason struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

https://dev.twitch.tv/docs/api/reference/#send-chat-message

type EmoteData

type EmoteData struct {
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	Images    EmoteImage `json:"images"`
	Format    []string   `json:"format"`
	Scale     []string   `json:"scale"`
	ThemeMode []string   `json:"theme_mode"`
}

func (EmoteData) MarshalEasyJSON added in v0.5.0

func (v EmoteData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EmoteData) MarshalJSON added in v0.5.0

func (v EmoteData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EmoteData) UnmarshalEasyJSON added in v0.5.0

func (v *EmoteData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EmoteData) UnmarshalJSON added in v0.5.0

func (v *EmoteData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EmoteImage

type EmoteImage struct {
	URL1X string `json:"url_1x"`
	URL2X string `json:"url_2x"`
	URL4X string `json:"url_4x"`
}

func (EmoteImage) MarshalEasyJSON added in v0.5.0

func (v EmoteImage) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EmoteImage) MarshalJSON added in v0.5.0

func (v EmoteImage) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EmoteImage) UnmarshalEasyJSON added in v0.5.0

func (v *EmoteImage) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EmoteImage) UnmarshalJSON added in v0.5.0

func (v *EmoteImage) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EmoteResponse

type EmoteResponse struct {
	Data     []EmoteData `json:"data"`
	Template string      `json:"template"`
}

func (EmoteResponse) MarshalEasyJSON added in v0.5.0

func (v EmoteResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EmoteResponse) MarshalJSON added in v0.5.0

func (v EmoteResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EmoteResponse) UnmarshalEasyJSON added in v0.5.0

func (v *EmoteResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EmoteResponse) UnmarshalJSON added in v0.5.0

func (v *EmoteResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventSubData added in v0.3.0

type EventSubData struct {
	ID        string            `json:"id"`
	Status    string            `json:"status"`
	Type      string            `json:"type"`
	Version   string            `json:"version"`
	Condition map[string]string `json:"condition"`
	CreatedAt time.Time         `json:"created_at"`
	Transport EventSubTransport `json:"transport"`
	Cost      int               `json:"cost"`
}

func (EventSubData) MarshalEasyJSON added in v0.5.0

func (v EventSubData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventSubData) MarshalJSON added in v0.5.0

func (v EventSubData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventSubData) UnmarshalEasyJSON added in v0.5.0

func (v *EventSubData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventSubData) UnmarshalJSON added in v0.5.0

func (v *EventSubData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventSubTransport added in v0.3.0

type EventSubTransport struct {
	Method    string `json:"method"`
	ConduitID string `json:"conduit_id"`
}

func (EventSubTransport) MarshalEasyJSON added in v0.5.0

func (v EventSubTransport) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventSubTransport) MarshalJSON added in v0.5.0

func (v EventSubTransport) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventSubTransport) UnmarshalEasyJSON added in v0.5.0

func (v *EventSubTransport) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventSubTransport) UnmarshalJSON added in v0.5.0

func (v *EventSubTransport) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventSubTransportRequest added in v0.3.0

type EventSubTransportRequest struct {
	Method    string `json:"method"`
	Callback  string `json:"callback"`
	ConduitID string `json:"conduit_id"`
	Secret    string `json:"secret"`
	SessionID string `json:"session_id"`
}

func (EventSubTransportRequest) MarshalEasyJSON added in v0.5.0

func (v EventSubTransportRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventSubTransportRequest) MarshalJSON added in v0.5.0

func (v EventSubTransportRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventSubTransportRequest) UnmarshalEasyJSON added in v0.5.0

func (v *EventSubTransportRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventSubTransportRequest) UnmarshalJSON added in v0.5.0

func (v *EventSubTransportRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type FollowedChannel added in v0.2.0

type FollowedChannel struct {
	BroadcasterID    string    `json:"broadcaster_id"`
	BroadcasterLogin string    `json:"broadcaster_login"`
	BroadcasterName  string    `json:"broadcaster_name"`
	FollowedAt       time.Time `json:"followed_at"`
}

func (FollowedChannel) MarshalEasyJSON added in v0.5.0

func (v FollowedChannel) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (FollowedChannel) MarshalJSON added in v0.5.0

func (v FollowedChannel) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*FollowedChannel) UnmarshalEasyJSON added in v0.5.0

func (v *FollowedChannel) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*FollowedChannel) UnmarshalJSON added in v0.5.0

func (v *FollowedChannel) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetChannelChatBadgesResp added in v0.5.3

type GetChannelChatBadgesResp struct {
	Data []ChannelChatBadges `json:"data"`
}

func (GetChannelChatBadgesResp) MarshalEasyJSON added in v0.5.3

func (v GetChannelChatBadgesResp) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetChannelChatBadgesResp) MarshalJSON added in v0.5.3

func (v GetChannelChatBadgesResp) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetChannelChatBadgesResp) UnmarshalEasyJSON added in v0.5.3

func (v *GetChannelChatBadgesResp) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetChannelChatBadgesResp) UnmarshalJSON added in v0.5.3

func (v *GetChannelChatBadgesResp) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetChatSettingsResponse

type GetChatSettingsResponse struct {
	Data []ChatSettingData `json:"data"`
}

func (GetChatSettingsResponse) MarshalEasyJSON added in v0.5.0

func (v GetChatSettingsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetChatSettingsResponse) MarshalJSON added in v0.5.0

func (v GetChatSettingsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetChatSettingsResponse) UnmarshalEasyJSON added in v0.5.0

func (v *GetChatSettingsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetChatSettingsResponse) UnmarshalJSON added in v0.5.0

func (v *GetChatSettingsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetEventSubSubscriptionsResponse added in v0.3.0

type GetEventSubSubscriptionsResponse struct {
	Total        int            `json:"total"`
	TotalCost    int            `json:"total_cost"`
	MaxTotalCost int            `json:"max_total_cost"`
	Pagination   Pagination     `json:"pagination"`
	Data         []EventSubData `json:"data"`
}

func (GetEventSubSubscriptionsResponse) MarshalEasyJSON added in v0.5.0

func (v GetEventSubSubscriptionsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetEventSubSubscriptionsResponse) MarshalJSON added in v0.5.0

func (v GetEventSubSubscriptionsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetEventSubSubscriptionsResponse) UnmarshalEasyJSON added in v0.5.0

func (v *GetEventSubSubscriptionsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetEventSubSubscriptionsResponse) UnmarshalJSON added in v0.5.0

func (v *GetEventSubSubscriptionsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetFollowedChannelsResponse added in v0.2.0

type GetFollowedChannelsResponse struct {
	Total      int               `json:"total"`
	Data       []FollowedChannel `json:"data"`
	Pagination Pagination        `json:"pagination"`
}

func (GetFollowedChannelsResponse) MarshalEasyJSON added in v0.5.0

func (v GetFollowedChannelsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetFollowedChannelsResponse) MarshalJSON added in v0.5.0

func (v GetFollowedChannelsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetFollowedChannelsResponse) UnmarshalEasyJSON added in v0.5.0

func (v *GetFollowedChannelsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetFollowedChannelsResponse) UnmarshalJSON added in v0.5.0

func (v *GetFollowedChannelsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetStreamsResponse

type GetStreamsResponse struct {
	Data       []StreamData `json:"data"`
	Pagination Pagination   `json:"pagination"`
}

func (GetStreamsResponse) MarshalEasyJSON added in v0.5.0

func (v GetStreamsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetStreamsResponse) MarshalJSON added in v0.5.0

func (v GetStreamsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetStreamsResponse) UnmarshalEasyJSON added in v0.5.0

func (v *GetStreamsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetStreamsResponse) UnmarshalJSON added in v0.5.0

func (v *GetStreamsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetUnbanRequestsResponse added in v0.0.4

type GetUnbanRequestsResponse struct {
	Data       []UnbanRequest `json:"data"`
	Pagination Pagination     `json:"pagination"`
}

func (GetUnbanRequestsResponse) MarshalEasyJSON added in v0.5.0

func (v GetUnbanRequestsResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetUnbanRequestsResponse) MarshalJSON added in v0.5.0

func (v GetUnbanRequestsResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetUnbanRequestsResponse) UnmarshalEasyJSON added in v0.5.0

func (v *GetUnbanRequestsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetUnbanRequestsResponse) UnmarshalJSON added in v0.5.0

func (v *GetUnbanRequestsResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetUserChatColorResponse added in v0.5.3

type GetUserChatColorResponse struct {
	Data []UserChatColor `json:"data"`
}

func (GetUserChatColorResponse) MarshalEasyJSON added in v0.5.3

func (v GetUserChatColorResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetUserChatColorResponse) MarshalJSON added in v0.5.3

func (v GetUserChatColorResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetUserChatColorResponse) UnmarshalEasyJSON added in v0.5.3

func (v *GetUserChatColorResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetUserChatColorResponse) UnmarshalJSON added in v0.5.3

func (v *GetUserChatColorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetUserEmotesResponse added in v0.5.1

type GetUserEmotesResponse struct {
	Data       []UserEmoteImage `json:"data"`
	Template   string           `json:"template"`
	Pagination Pagination       `json:"pagination"`
}

func (GetUserEmotesResponse) MarshalEasyJSON added in v0.5.1

func (v GetUserEmotesResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetUserEmotesResponse) MarshalJSON added in v0.5.1

func (v GetUserEmotesResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetUserEmotesResponse) UnmarshalEasyJSON added in v0.5.1

func (v *GetUserEmotesResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetUserEmotesResponse) UnmarshalJSON added in v0.5.1

func (v *GetUserEmotesResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type IRCer

type IRCer interface {
	IRC() string
}

IRCer are types that can be turned into an IRC command

func ParseIRC added in v0.3.0

func ParseIRC(message string) (IRCer, error)

type Pagination

type Pagination struct {
	Cursor string `json:"cursor"`
}

func (Pagination) MarshalEasyJSON added in v0.5.0

func (v Pagination) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Pagination) MarshalJSON added in v0.5.0

func (v Pagination) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Pagination) UnmarshalEasyJSON added in v0.5.0

func (v *Pagination) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Pagination) UnmarshalJSON added in v0.5.0

func (v *Pagination) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RetryReachedError

type RetryReachedError struct {
	// contains filtered or unexported fields
}

func (RetryReachedError) Error

func (e RetryReachedError) Error() string

func (RetryReachedError) Unwrap

func (e RetryReachedError) Unwrap() error

type SendChatMessageData added in v0.6.0

type SendChatMessageData struct {
	MessageID  string     `json:"message_id"`
	IsSent     bool       `json:"is_sent"`
	DropReason DropReason `json:"drop_reason"`
}

https://dev.twitch.tv/docs/api/reference/#send-chat-message

type SendChatMessageRequest added in v0.6.0

type SendChatMessageRequest struct {
	BroadcasterID string `json:"broadcaster_id"`
	SenderID      string `json:"sender_id"`
	Message       string `json:"message"`

	ReplyMessageID string `json:"reply_parent_message_id"`
	ForSourceOnly  bool   `json:"for_source_only,omitempty"`
}

https://dev.twitch.tv/docs/api/reference/#send-chat-message

type SendChatMessageResponse added in v0.6.0

type SendChatMessageResponse struct {
	Data []SendChatMessageData `json:"data"`
}

https://dev.twitch.tv/docs/api/reference/#send-chat-message

type StreamData

type StreamData 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"`
	Type         string    `json:"type"`
	Title        string    `json:"title"`
	Tags         []string  `json:"tags"`
	ViewerCount  int       `json:"viewer_count"`
	StartedAt    time.Time `json:"started_at"`
	Language     string    `json:"language"`
	ThumbnailURL string    `json:"thumbnail_url"`
	TagIds       []any     `json:"tag_ids"`
	IsMature     bool      `json:"is_mature"`
}

func (StreamData) MarshalEasyJSON added in v0.5.0

func (v StreamData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (StreamData) MarshalJSON added in v0.5.0

func (v StreamData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*StreamData) UnmarshalEasyJSON added in v0.5.0

func (v *StreamData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*StreamData) UnmarshalJSON added in v0.5.0

func (v *StreamData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type StreamMarker added in v0.5.1

type StreamMarker struct {
	ID              string    `json:"id"`
	CreatedAt       time.Time `json:"created_at"`
	PositionSeconds int       `json:"position_seconds"`
	Description     string    `json:"description"`
}

func (StreamMarker) MarshalEasyJSON added in v0.5.1

func (v StreamMarker) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (StreamMarker) MarshalJSON added in v0.5.1

func (v StreamMarker) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*StreamMarker) UnmarshalEasyJSON added in v0.5.1

func (v *StreamMarker) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*StreamMarker) UnmarshalJSON added in v0.5.1

func (v *StreamMarker) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TokenRefresher

type TokenRefresher interface {
	RefreshToken(ctx context.Context, refreshToken string) (string, string, error)
}

type UnbanRequest added in v0.0.4

type UnbanRequest struct {
	ID               string    `json:"id"`
	BroadcasterName  string    `json:"broadcaster_name"`
	BroadcasterLogin string    `json:"broadcaster_login"`
	BroadcasterID    string    `json:"broadcaster_id"`
	ModeratorID      string    `json:"moderator_id"`
	ModeratorLogin   string    `json:"moderator_login"`
	ModeratorName    string    `json:"moderator_name"`
	UserID           string    `json:"user_id"`
	UserLogin        string    `json:"user_login"`
	UserName         string    `json:"user_name"`
	Text             string    `json:"text"`
	Status           string    `json:"status"`
	CreatedAt        time.Time `json:"created_at"`
	ResolvedAt       time.Time `json:"resolved_at"`
	ResolutionText   string    `json:"resolution_text"`
}

func (UnbanRequest) MarshalEasyJSON added in v0.5.0

func (v UnbanRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UnbanRequest) MarshalJSON added in v0.5.0

func (v UnbanRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UnbanRequest) UnmarshalEasyJSON added in v0.5.0

func (v *UnbanRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UnbanRequest) UnmarshalJSON added in v0.5.0

func (v *UnbanRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserChatColor added in v0.5.3

type UserChatColor struct {
	Color     string `json:"color"`
	UserName  string `json:"user_name"`
	UserLogin string `json:"user_login"`
	UserID    string `json:"user_id"`
}

func (UserChatColor) MarshalEasyJSON added in v0.5.3

func (v UserChatColor) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserChatColor) MarshalJSON added in v0.5.3

func (v UserChatColor) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserChatColor) UnmarshalEasyJSON added in v0.5.3

func (v *UserChatColor) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserChatColor) UnmarshalJSON added in v0.5.3

func (v *UserChatColor) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserData

type UserData 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.Time `json:"created_at"`
}

func (UserData) MarshalEasyJSON added in v0.5.0

func (v UserData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserData) MarshalJSON added in v0.5.0

func (v UserData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserData) UnmarshalEasyJSON added in v0.5.0

func (v *UserData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserData) UnmarshalJSON added in v0.5.0

func (v *UserData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserEmoteImage added in v0.5.1

type UserEmoteImage struct {
	ID         string   `json:"id"`
	EmoteSetID string   `json:"emote_set_id"`
	EmoteType  string   `json:"emote_type"`
	Format     []string `json:"format"`
	Name       string   `json:"name"`
	OwnerID    string   `json:"owner_id"`
	Scale      []string `json:"scale"`
	ThemeMode  []string `json:"theme_mode"`
}

func (UserEmoteImage) MarshalEasyJSON added in v0.5.1

func (v UserEmoteImage) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserEmoteImage) MarshalJSON added in v0.5.1

func (v UserEmoteImage) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserEmoteImage) UnmarshalEasyJSON added in v0.5.1

func (v *UserEmoteImage) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserEmoteImage) UnmarshalJSON added in v0.5.1

func (v *UserEmoteImage) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserResponse

type UserResponse struct {
	Data []UserData `json:"data"`
}

func (UserResponse) MarshalEasyJSON added in v0.5.0

func (v UserResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserResponse) MarshalJSON added in v0.5.0

func (v UserResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserResponse) UnmarshalEasyJSON added in v0.5.0

func (v *UserResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserResponse) UnmarshalJSON added in v0.5.0

func (v *UserResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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