twitchmocks

package
v0.0.0-...-9d56c50 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIMock

type APIMock struct {
	// AnnounceFunc mocks the Announce method.
	AnnounceFunc func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, message string, color string) (*oauth2.Token, error)

	// AuthCodeURLFunc mocks the AuthCodeURL method.
	AuthCodeURLFunc func(state string, scopes []string) string

	// BanFunc mocks the Ban method.
	BanFunc func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, req *twitch.BanRequest) (*oauth2.Token, error)

	// ClearChatFunc mocks the ClearChat method.
	ClearChatFunc func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token) (*oauth2.Token, error)

	// CreateChatSubscriptionFunc mocks the CreateChatSubscription method.
	CreateChatSubscriptionFunc func(ctx context.Context, conduitID string, broadcasterID int64, botID int64) error

	// CreateConduitFunc mocks the CreateConduit method.
	CreateConduitFunc func(ctx context.Context, shardCount int) (*twitch.Conduit, error)

	// DeleteChatMessageFunc mocks the DeleteChatMessage method.
	DeleteChatMessageFunc func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, id string) (*oauth2.Token, error)

	// DeleteConduitFunc mocks the DeleteConduit method.
	DeleteConduitFunc func(ctx context.Context, id string) error

	// DeleteSubscriptionFunc mocks the DeleteSubscription method.
	DeleteSubscriptionFunc func(ctx context.Context, id string) error

	// ExchangeFunc mocks the Exchange method.
	ExchangeFunc func(ctx context.Context, code string) (*oauth2.Token, error)

	// GetChannelByIDFunc mocks the GetChannelByID method.
	GetChannelByIDFunc func(ctx context.Context, id int64) (*twitch.Channel, error)

	// GetChannelModeratorsFunc mocks the GetChannelModerators method.
	GetChannelModeratorsFunc func(ctx context.Context, id int64, userToken *oauth2.Token) ([]*twitch.ChannelModerator, *oauth2.Token, error)

	// GetConduitsFunc mocks the GetConduits method.
	GetConduitsFunc func(ctx context.Context) ([]*twitch.Conduit, error)

	// GetGameByIDFunc mocks the GetGameByID method.
	GetGameByIDFunc func(ctx context.Context, id int64) (*twitch.Category, error)

	// GetGameByNameFunc mocks the GetGameByName method.
	GetGameByNameFunc func(ctx context.Context, name string) (*twitch.Category, error)

	// GetGameLinksFunc mocks the GetGameLinks method.
	GetGameLinksFunc func(ctx context.Context, twitchCategory int64) ([]twitch.GameLink, error)

	// GetModeratedChannelsFunc mocks the GetModeratedChannels method.
	GetModeratedChannelsFunc func(ctx context.Context, modID int64, modToken *oauth2.Token) ([]*twitch.ModeratedChannel, *oauth2.Token, error)

	// GetStreamByUserIDFunc mocks the GetStreamByUserID method.
	GetStreamByUserIDFunc func(ctx context.Context, id int64) (*twitch.Stream, error)

	// GetStreamByUsernameFunc mocks the GetStreamByUsername method.
	GetStreamByUsernameFunc func(ctx context.Context, username string) (*twitch.Stream, error)

	// GetSubscriptionsFunc mocks the GetSubscriptions method.
	GetSubscriptionsFunc func(ctx context.Context) ([]*eventsub.Subscription, error)

	// GetUserByIDFunc mocks the GetUserByID method.
	GetUserByIDFunc func(ctx context.Context, id int64) (*twitch.User, error)

	// GetUserByTokenFunc mocks the GetUserByToken method.
	GetUserByTokenFunc func(ctx context.Context, userToken *oauth2.Token) (*twitch.User, *oauth2.Token, error)

	// GetUserByUsernameFunc mocks the GetUserByUsername method.
	GetUserByUsernameFunc func(ctx context.Context, username string) (*twitch.User, error)

	// ModifyChannelFunc mocks the ModifyChannel method.
	ModifyChannelFunc func(ctx context.Context, broadcasterID int64, userToken *oauth2.Token, title *string, gameID *int64) (*oauth2.Token, error)

	// SearchCategoriesFunc mocks the SearchCategories method.
	SearchCategoriesFunc func(ctx context.Context, query string) ([]*twitch.Category, error)

	// SendChatMessageFunc mocks the SendChatMessage method.
	SendChatMessageFunc func(ctx context.Context, broadcasterID int64, senderID int64, senderToken *oauth2.Token, message string) (*oauth2.Token, error)

	// SetChatColorFunc mocks the SetChatColor method.
	SetChatColorFunc func(ctx context.Context, userID int64, userToken *oauth2.Token, color string) (*oauth2.Token, error)

	// UnbanFunc mocks the Unban method.
	UnbanFunc func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, userID int64) (*oauth2.Token, error)

	// UpdateChatSettingsFunc mocks the UpdateChatSettings method.
	UpdateChatSettingsFunc func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, patch *twitch.ChatSettingsPatch) (*oauth2.Token, error)

	// UpdateConduitFunc mocks the UpdateConduit method.
	UpdateConduitFunc func(ctx context.Context, id string, shardCount int) (*twitch.Conduit, error)

	// UpdateShardsFunc mocks the UpdateShards method.
	UpdateShardsFunc func(ctx context.Context, conduitID string, shards []*twitch.Shard) error

	// ValidateFunc mocks the Validate method.
	ValidateFunc func(ctx context.Context, tok *oauth2.Token) (*twitch.Validation, *oauth2.Token, error)
	// contains filtered or unexported fields
}

APIMock is a mock implementation of twitch.API.

func TestSomethingThatUsesAPI(t *testing.T) {

	// make and configure a mocked twitch.API
	mockedAPI := &APIMock{
		AnnounceFunc: func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, message string, color string) (*oauth2.Token, error) {
			panic("mock out the Announce method")
		},
		AuthCodeURLFunc: func(state string, scopes []string) string {
			panic("mock out the AuthCodeURL method")
		},
		BanFunc: func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, req *twitch.BanRequest) (*oauth2.Token, error) {
			panic("mock out the Ban method")
		},
		ClearChatFunc: func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token) (*oauth2.Token, error) {
			panic("mock out the ClearChat method")
		},
		CreateChatSubscriptionFunc: func(ctx context.Context, conduitID string, broadcasterID int64, botID int64) error {
			panic("mock out the CreateChatSubscription method")
		},
		CreateConduitFunc: func(ctx context.Context, shardCount int) (*twitch.Conduit, error) {
			panic("mock out the CreateConduit method")
		},
		DeleteChatMessageFunc: func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, id string) (*oauth2.Token, error) {
			panic("mock out the DeleteChatMessage method")
		},
		DeleteConduitFunc: func(ctx context.Context, id string) error {
			panic("mock out the DeleteConduit method")
		},
		DeleteSubscriptionFunc: func(ctx context.Context, id string) error {
			panic("mock out the DeleteSubscription method")
		},
		ExchangeFunc: func(ctx context.Context, code string) (*oauth2.Token, error) {
			panic("mock out the Exchange method")
		},
		GetChannelByIDFunc: func(ctx context.Context, id int64) (*twitch.Channel, error) {
			panic("mock out the GetChannelByID method")
		},
		GetChannelModeratorsFunc: func(ctx context.Context, id int64, userToken *oauth2.Token) ([]*twitch.ChannelModerator, *oauth2.Token, error) {
			panic("mock out the GetChannelModerators method")
		},
		GetConduitsFunc: func(ctx context.Context) ([]*twitch.Conduit, error) {
			panic("mock out the GetConduits method")
		},
		GetGameByIDFunc: func(ctx context.Context, id int64) (*twitch.Category, error) {
			panic("mock out the GetGameByID method")
		},
		GetGameByNameFunc: func(ctx context.Context, name string) (*twitch.Category, error) {
			panic("mock out the GetGameByName method")
		},
		GetGameLinksFunc: func(ctx context.Context, twitchCategory int64) ([]twitch.GameLink, error) {
			panic("mock out the GetGameLinks method")
		},
		GetModeratedChannelsFunc: func(ctx context.Context, modID int64, modToken *oauth2.Token) ([]*twitch.ModeratedChannel, *oauth2.Token, error) {
			panic("mock out the GetModeratedChannels method")
		},
		GetStreamByUserIDFunc: func(ctx context.Context, id int64) (*twitch.Stream, error) {
			panic("mock out the GetStreamByUserID method")
		},
		GetStreamByUsernameFunc: func(ctx context.Context, username string) (*twitch.Stream, error) {
			panic("mock out the GetStreamByUsername method")
		},
		GetSubscriptionsFunc: func(ctx context.Context) ([]*eventsub.Subscription, error) {
			panic("mock out the GetSubscriptions method")
		},
		GetUserByIDFunc: func(ctx context.Context, id int64) (*twitch.User, error) {
			panic("mock out the GetUserByID method")
		},
		GetUserByTokenFunc: func(ctx context.Context, userToken *oauth2.Token) (*twitch.User, *oauth2.Token, error) {
			panic("mock out the GetUserByToken method")
		},
		GetUserByUsernameFunc: func(ctx context.Context, username string) (*twitch.User, error) {
			panic("mock out the GetUserByUsername method")
		},
		ModifyChannelFunc: func(ctx context.Context, broadcasterID int64, userToken *oauth2.Token, title *string, gameID *int64) (*oauth2.Token, error) {
			panic("mock out the ModifyChannel method")
		},
		SearchCategoriesFunc: func(ctx context.Context, query string) ([]*twitch.Category, error) {
			panic("mock out the SearchCategories method")
		},
		SendChatMessageFunc: func(ctx context.Context, broadcasterID int64, senderID int64, senderToken *oauth2.Token, message string) (*oauth2.Token, error) {
			panic("mock out the SendChatMessage method")
		},
		SetChatColorFunc: func(ctx context.Context, userID int64, userToken *oauth2.Token, color string) (*oauth2.Token, error) {
			panic("mock out the SetChatColor method")
		},
		UnbanFunc: func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, userID int64) (*oauth2.Token, error) {
			panic("mock out the Unban method")
		},
		UpdateChatSettingsFunc: func(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, patch *twitch.ChatSettingsPatch) (*oauth2.Token, error) {
			panic("mock out the UpdateChatSettings method")
		},
		UpdateConduitFunc: func(ctx context.Context, id string, shardCount int) (*twitch.Conduit, error) {
			panic("mock out the UpdateConduit method")
		},
		UpdateShardsFunc: func(ctx context.Context, conduitID string, shards []*twitch.Shard) error {
			panic("mock out the UpdateShards method")
		},
		ValidateFunc: func(ctx context.Context, tok *oauth2.Token) (*twitch.Validation, *oauth2.Token, error) {
			panic("mock out the Validate method")
		},
	}

	// use mockedAPI in code that requires twitch.API
	// and then make assertions.

}

func (*APIMock) Announce

func (mock *APIMock) Announce(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, message string, color string) (*oauth2.Token, error)

Announce calls AnnounceFunc.

func (*APIMock) AnnounceCalls

func (mock *APIMock) AnnounceCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	ModID         int64
	ModToken      *oauth2.Token
	Message       string
	Color         string
}

AnnounceCalls gets all the calls that were made to Announce. Check the length with:

len(mockedAPI.AnnounceCalls())

func (*APIMock) AuthCodeURL

func (mock *APIMock) AuthCodeURL(state string, scopes []string) string

AuthCodeURL calls AuthCodeURLFunc.

func (*APIMock) AuthCodeURLCalls

func (mock *APIMock) AuthCodeURLCalls() []struct {
	State  string
	Scopes []string
}

AuthCodeURLCalls gets all the calls that were made to AuthCodeURL. Check the length with:

len(mockedAPI.AuthCodeURLCalls())

func (*APIMock) Ban

func (mock *APIMock) Ban(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, req *twitch.BanRequest) (*oauth2.Token, error)

Ban calls BanFunc.

func (*APIMock) BanCalls

func (mock *APIMock) BanCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	ModID         int64
	ModToken      *oauth2.Token
	Req           *twitch.BanRequest
}

BanCalls gets all the calls that were made to Ban. Check the length with:

len(mockedAPI.BanCalls())

func (*APIMock) ClearChat

func (mock *APIMock) ClearChat(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token) (*oauth2.Token, error)

ClearChat calls ClearChatFunc.

func (*APIMock) ClearChatCalls

func (mock *APIMock) ClearChatCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	ModID         int64
	ModToken      *oauth2.Token
}

ClearChatCalls gets all the calls that were made to ClearChat. Check the length with:

len(mockedAPI.ClearChatCalls())

func (*APIMock) CreateChatSubscription

func (mock *APIMock) CreateChatSubscription(ctx context.Context, conduitID string, broadcasterID int64, botID int64) error

CreateChatSubscription calls CreateChatSubscriptionFunc.

func (*APIMock) CreateChatSubscriptionCalls

func (mock *APIMock) CreateChatSubscriptionCalls() []struct {
	Ctx           context.Context
	ConduitID     string
	BroadcasterID int64
	BotID         int64
}

CreateChatSubscriptionCalls gets all the calls that were made to CreateChatSubscription. Check the length with:

len(mockedAPI.CreateChatSubscriptionCalls())

func (*APIMock) CreateConduit

func (mock *APIMock) CreateConduit(ctx context.Context, shardCount int) (*twitch.Conduit, error)

CreateConduit calls CreateConduitFunc.

func (*APIMock) CreateConduitCalls

func (mock *APIMock) CreateConduitCalls() []struct {
	Ctx        context.Context
	ShardCount int
}

CreateConduitCalls gets all the calls that were made to CreateConduit. Check the length with:

len(mockedAPI.CreateConduitCalls())

func (*APIMock) DeleteChatMessage

func (mock *APIMock) DeleteChatMessage(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, id string) (*oauth2.Token, error)

DeleteChatMessage calls DeleteChatMessageFunc.

func (*APIMock) DeleteChatMessageCalls

func (mock *APIMock) DeleteChatMessageCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	ModID         int64
	ModToken      *oauth2.Token
	ID            string
}

DeleteChatMessageCalls gets all the calls that were made to DeleteChatMessage. Check the length with:

len(mockedAPI.DeleteChatMessageCalls())

func (*APIMock) DeleteConduit

func (mock *APIMock) DeleteConduit(ctx context.Context, id string) error

DeleteConduit calls DeleteConduitFunc.

func (*APIMock) DeleteConduitCalls

func (mock *APIMock) DeleteConduitCalls() []struct {
	Ctx context.Context
	ID  string
}

DeleteConduitCalls gets all the calls that were made to DeleteConduit. Check the length with:

len(mockedAPI.DeleteConduitCalls())

func (*APIMock) DeleteSubscription

func (mock *APIMock) DeleteSubscription(ctx context.Context, id string) error

DeleteSubscription calls DeleteSubscriptionFunc.

func (*APIMock) DeleteSubscriptionCalls

func (mock *APIMock) DeleteSubscriptionCalls() []struct {
	Ctx context.Context
	ID  string
}

DeleteSubscriptionCalls gets all the calls that were made to DeleteSubscription. Check the length with:

len(mockedAPI.DeleteSubscriptionCalls())

func (*APIMock) Exchange

func (mock *APIMock) Exchange(ctx context.Context, code string) (*oauth2.Token, error)

Exchange calls ExchangeFunc.

func (*APIMock) ExchangeCalls

func (mock *APIMock) ExchangeCalls() []struct {
	Ctx  context.Context
	Code string
}

ExchangeCalls gets all the calls that were made to Exchange. Check the length with:

len(mockedAPI.ExchangeCalls())

func (*APIMock) GetChannelByID

func (mock *APIMock) GetChannelByID(ctx context.Context, id int64) (*twitch.Channel, error)

GetChannelByID calls GetChannelByIDFunc.

func (*APIMock) GetChannelByIDCalls

func (mock *APIMock) GetChannelByIDCalls() []struct {
	Ctx context.Context
	ID  int64
}

GetChannelByIDCalls gets all the calls that were made to GetChannelByID. Check the length with:

len(mockedAPI.GetChannelByIDCalls())

func (*APIMock) GetChannelModerators

func (mock *APIMock) GetChannelModerators(ctx context.Context, id int64, userToken *oauth2.Token) ([]*twitch.ChannelModerator, *oauth2.Token, error)

GetChannelModerators calls GetChannelModeratorsFunc.

func (*APIMock) GetChannelModeratorsCalls

func (mock *APIMock) GetChannelModeratorsCalls() []struct {
	Ctx       context.Context
	ID        int64
	UserToken *oauth2.Token
}

GetChannelModeratorsCalls gets all the calls that were made to GetChannelModerators. Check the length with:

len(mockedAPI.GetChannelModeratorsCalls())

func (*APIMock) GetConduits

func (mock *APIMock) GetConduits(ctx context.Context) ([]*twitch.Conduit, error)

GetConduits calls GetConduitsFunc.

func (*APIMock) GetConduitsCalls

func (mock *APIMock) GetConduitsCalls() []struct {
	Ctx context.Context
}

GetConduitsCalls gets all the calls that were made to GetConduits. Check the length with:

len(mockedAPI.GetConduitsCalls())

func (*APIMock) GetGameByID

func (mock *APIMock) GetGameByID(ctx context.Context, id int64) (*twitch.Category, error)

GetGameByID calls GetGameByIDFunc.

func (*APIMock) GetGameByIDCalls

func (mock *APIMock) GetGameByIDCalls() []struct {
	Ctx context.Context
	ID  int64
}

GetGameByIDCalls gets all the calls that were made to GetGameByID. Check the length with:

len(mockedAPI.GetGameByIDCalls())

func (*APIMock) GetGameByName

func (mock *APIMock) GetGameByName(ctx context.Context, name string) (*twitch.Category, error)

GetGameByName calls GetGameByNameFunc.

func (*APIMock) GetGameByNameCalls

func (mock *APIMock) GetGameByNameCalls() []struct {
	Ctx  context.Context
	Name string
}

GetGameByNameCalls gets all the calls that were made to GetGameByName. Check the length with:

len(mockedAPI.GetGameByNameCalls())
func (mock *APIMock) GetGameLinks(ctx context.Context, twitchCategory int64) ([]twitch.GameLink, error)

GetGameLinks calls GetGameLinksFunc.

func (*APIMock) GetGameLinksCalls

func (mock *APIMock) GetGameLinksCalls() []struct {
	Ctx            context.Context
	TwitchCategory int64
}

GetGameLinksCalls gets all the calls that were made to GetGameLinks. Check the length with:

len(mockedAPI.GetGameLinksCalls())

func (*APIMock) GetModeratedChannels

func (mock *APIMock) GetModeratedChannels(ctx context.Context, modID int64, modToken *oauth2.Token) ([]*twitch.ModeratedChannel, *oauth2.Token, error)

GetModeratedChannels calls GetModeratedChannelsFunc.

func (*APIMock) GetModeratedChannelsCalls

func (mock *APIMock) GetModeratedChannelsCalls() []struct {
	Ctx      context.Context
	ModID    int64
	ModToken *oauth2.Token
}

GetModeratedChannelsCalls gets all the calls that were made to GetModeratedChannels. Check the length with:

len(mockedAPI.GetModeratedChannelsCalls())

func (*APIMock) GetStreamByUserID

func (mock *APIMock) GetStreamByUserID(ctx context.Context, id int64) (*twitch.Stream, error)

GetStreamByUserID calls GetStreamByUserIDFunc.

func (*APIMock) GetStreamByUserIDCalls

func (mock *APIMock) GetStreamByUserIDCalls() []struct {
	Ctx context.Context
	ID  int64
}

GetStreamByUserIDCalls gets all the calls that were made to GetStreamByUserID. Check the length with:

len(mockedAPI.GetStreamByUserIDCalls())

func (*APIMock) GetStreamByUsername

func (mock *APIMock) GetStreamByUsername(ctx context.Context, username string) (*twitch.Stream, error)

GetStreamByUsername calls GetStreamByUsernameFunc.

func (*APIMock) GetStreamByUsernameCalls

func (mock *APIMock) GetStreamByUsernameCalls() []struct {
	Ctx      context.Context
	Username string
}

GetStreamByUsernameCalls gets all the calls that were made to GetStreamByUsername. Check the length with:

len(mockedAPI.GetStreamByUsernameCalls())

func (*APIMock) GetSubscriptions

func (mock *APIMock) GetSubscriptions(ctx context.Context) ([]*eventsub.Subscription, error)

GetSubscriptions calls GetSubscriptionsFunc.

func (*APIMock) GetSubscriptionsCalls

func (mock *APIMock) GetSubscriptionsCalls() []struct {
	Ctx context.Context
}

GetSubscriptionsCalls gets all the calls that were made to GetSubscriptions. Check the length with:

len(mockedAPI.GetSubscriptionsCalls())

func (*APIMock) GetUserByID

func (mock *APIMock) GetUserByID(ctx context.Context, id int64) (*twitch.User, error)

GetUserByID calls GetUserByIDFunc.

func (*APIMock) GetUserByIDCalls

func (mock *APIMock) GetUserByIDCalls() []struct {
	Ctx context.Context
	ID  int64
}

GetUserByIDCalls gets all the calls that were made to GetUserByID. Check the length with:

len(mockedAPI.GetUserByIDCalls())

func (*APIMock) GetUserByToken

func (mock *APIMock) GetUserByToken(ctx context.Context, userToken *oauth2.Token) (*twitch.User, *oauth2.Token, error)

GetUserByToken calls GetUserByTokenFunc.

func (*APIMock) GetUserByTokenCalls

func (mock *APIMock) GetUserByTokenCalls() []struct {
	Ctx       context.Context
	UserToken *oauth2.Token
}

GetUserByTokenCalls gets all the calls that were made to GetUserByToken. Check the length with:

len(mockedAPI.GetUserByTokenCalls())

func (*APIMock) GetUserByUsername

func (mock *APIMock) GetUserByUsername(ctx context.Context, username string) (*twitch.User, error)

GetUserByUsername calls GetUserByUsernameFunc.

func (*APIMock) GetUserByUsernameCalls

func (mock *APIMock) GetUserByUsernameCalls() []struct {
	Ctx      context.Context
	Username string
}

GetUserByUsernameCalls gets all the calls that were made to GetUserByUsername. Check the length with:

len(mockedAPI.GetUserByUsernameCalls())

func (*APIMock) ModifyChannel

func (mock *APIMock) ModifyChannel(ctx context.Context, broadcasterID int64, userToken *oauth2.Token, title *string, gameID *int64) (*oauth2.Token, error)

ModifyChannel calls ModifyChannelFunc.

func (*APIMock) ModifyChannelCalls

func (mock *APIMock) ModifyChannelCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	UserToken     *oauth2.Token
	Title         *string
	GameID        *int64
}

ModifyChannelCalls gets all the calls that were made to ModifyChannel. Check the length with:

len(mockedAPI.ModifyChannelCalls())

func (*APIMock) SearchCategories

func (mock *APIMock) SearchCategories(ctx context.Context, query string) ([]*twitch.Category, error)

SearchCategories calls SearchCategoriesFunc.

func (*APIMock) SearchCategoriesCalls

func (mock *APIMock) SearchCategoriesCalls() []struct {
	Ctx   context.Context
	Query string
}

SearchCategoriesCalls gets all the calls that were made to SearchCategories. Check the length with:

len(mockedAPI.SearchCategoriesCalls())

func (*APIMock) SendChatMessage

func (mock *APIMock) SendChatMessage(ctx context.Context, broadcasterID int64, senderID int64, senderToken *oauth2.Token, message string) (*oauth2.Token, error)

SendChatMessage calls SendChatMessageFunc.

func (*APIMock) SendChatMessageCalls

func (mock *APIMock) SendChatMessageCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	SenderID      int64
	SenderToken   *oauth2.Token
	Message       string
}

SendChatMessageCalls gets all the calls that were made to SendChatMessage. Check the length with:

len(mockedAPI.SendChatMessageCalls())

func (*APIMock) SetChatColor

func (mock *APIMock) SetChatColor(ctx context.Context, userID int64, userToken *oauth2.Token, color string) (*oauth2.Token, error)

SetChatColor calls SetChatColorFunc.

func (*APIMock) SetChatColorCalls

func (mock *APIMock) SetChatColorCalls() []struct {
	Ctx       context.Context
	UserID    int64
	UserToken *oauth2.Token
	Color     string
}

SetChatColorCalls gets all the calls that were made to SetChatColor. Check the length with:

len(mockedAPI.SetChatColorCalls())

func (*APIMock) Unban

func (mock *APIMock) Unban(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, userID int64) (*oauth2.Token, error)

Unban calls UnbanFunc.

func (*APIMock) UnbanCalls

func (mock *APIMock) UnbanCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	ModID         int64
	ModToken      *oauth2.Token
	UserID        int64
}

UnbanCalls gets all the calls that were made to Unban. Check the length with:

len(mockedAPI.UnbanCalls())

func (*APIMock) UpdateChatSettings

func (mock *APIMock) UpdateChatSettings(ctx context.Context, broadcasterID int64, modID int64, modToken *oauth2.Token, patch *twitch.ChatSettingsPatch) (*oauth2.Token, error)

UpdateChatSettings calls UpdateChatSettingsFunc.

func (*APIMock) UpdateChatSettingsCalls

func (mock *APIMock) UpdateChatSettingsCalls() []struct {
	Ctx           context.Context
	BroadcasterID int64
	ModID         int64
	ModToken      *oauth2.Token
	Patch         *twitch.ChatSettingsPatch
}

UpdateChatSettingsCalls gets all the calls that were made to UpdateChatSettings. Check the length with:

len(mockedAPI.UpdateChatSettingsCalls())

func (*APIMock) UpdateConduit

func (mock *APIMock) UpdateConduit(ctx context.Context, id string, shardCount int) (*twitch.Conduit, error)

UpdateConduit calls UpdateConduitFunc.

func (*APIMock) UpdateConduitCalls

func (mock *APIMock) UpdateConduitCalls() []struct {
	Ctx        context.Context
	ID         string
	ShardCount int
}

UpdateConduitCalls gets all the calls that were made to UpdateConduit. Check the length with:

len(mockedAPI.UpdateConduitCalls())

func (*APIMock) UpdateShards

func (mock *APIMock) UpdateShards(ctx context.Context, conduitID string, shards []*twitch.Shard) error

UpdateShards calls UpdateShardsFunc.

func (*APIMock) UpdateShardsCalls

func (mock *APIMock) UpdateShardsCalls() []struct {
	Ctx       context.Context
	ConduitID string
	Shards    []*twitch.Shard
}

UpdateShardsCalls gets all the calls that were made to UpdateShards. Check the length with:

len(mockedAPI.UpdateShardsCalls())

func (*APIMock) Validate

func (mock *APIMock) Validate(ctx context.Context, tok *oauth2.Token) (*twitch.Validation, *oauth2.Token, error)

Validate calls ValidateFunc.

func (*APIMock) ValidateCalls

func (mock *APIMock) ValidateCalls() []struct {
	Ctx context.Context
	Tok *oauth2.Token
}

ValidateCalls gets all the calls that were made to Validate. Check the length with:

len(mockedAPI.ValidateCalls())

Jump to

Keyboard shortcuts

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