Documentation
¶
Index ¶
- Variables
- type API
- func (a *API) BanUser(ctx context.Context, broadcasterID string, data BanUserData) error
- func (a *API) GetChannelEmotes(ctx context.Context, broadcaster string) (EmoteResponse, error)
- func (a *API) GetChatSettings(ctx context.Context, broadcasterID string, moderatorID string) (GetChatSettingsResponse, error)
- func (a *API) GetGlobalEmotes(ctx context.Context) (EmoteResponse, error)
- func (a *API) GetStreamInfo(ctx context.Context, broadcastID []string) (GetStreamsResponse, error)
- func (a *API) GetUsers(ctx context.Context, logins []string, ids []string) (UserResponse, error)
- type APIError
- type APIOptionFunc
- type AccountProvider
- type BanUserData
- type BanUserRequest
- type Chat
- type ChatSettingData
- type EmoteData
- type EmoteImage
- type EmoteResponse
- type GetChatSettingsResponse
- type GetStreamsResponse
- type IRCer
- type Pagination
- type RetryReachedError
- type StreamData
- type TokenRefresher
- type UserData
- type UserResponse
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 (*API) GetChannelEmotes ¶
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 ¶
type APIError ¶
type APIError struct {
ErrorText string `json:"error"`
Status int `json:"status"`
Message string `json:"message"`
}
error response
type APIOptionFunc ¶
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 BanUserData ¶ added in v0.0.2
type BanUserRequest ¶ added in v0.0.2
type BanUserRequest struct {
Data BanUserData `json:"data"`
}
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
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
}
type EmoteData ¶
type EmoteImage ¶
type EmoteResponse ¶
type GetChatSettingsResponse ¶
type GetChatSettingsResponse struct {
Data []ChatSettingData `json:"data"`
}
type GetStreamsResponse ¶
type GetStreamsResponse struct {
Data []StreamData `json:"data"`
Pagination Pagination `json:"pagination"`
}
type IRCer ¶
type IRCer interface {
IRC() string
}
IRCer are types that can be turned into an IRC command
type Pagination ¶
type Pagination struct {
Cursor string `json:"cursor"`
}
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 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"`
}
type TokenRefresher ¶
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"`
}
type UserResponse ¶
type UserResponse struct {
Data []UserData `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.