Documentation
¶
Index ¶
- Constants
- func StructToMap(obj interface{}) (newMap map[string]interface{}, err error)
- type AppAccessToken
- type Asset
- type BotConfig
- type ChannelPointReward
- type Database
- func (db *Database) AddEventSubSubscription(targetTwitchID, subscriptionID, version, subType, foreignID string)
- func (db *Database) BlockEmoteAdd(channelTwitchID string, emoteID string)
- func (db *Database) BlockEmotes(channelTwitchID string, emoteIds []string, emoteType string) error
- func (s *Database) ClearNominationEmote(ctx context.Context, channelTwitchID string, emoteID string) error
- func (db *Database) ClearNominations(ctx context.Context, channelTwitchID string) error
- func (db *Database) CountNominationDownvotes(ctx context.Context, channelTwitchID string, votedBy string) (int, error)
- func (db *Database) CountNominationVotes(ctx context.Context, channelTwitchID string, voteBy string) (int, error)
- func (s *Database) CountNominations(ctx context.Context, channelTwitchID string, userID string) (int, error)
- func (db *Database) CreateAsset(ID string, mimeType string, blob []byte)
- func (db *Database) CreateEmoteAdd(channelTwitchID string, addType dto.RewardType, emoteID string, ...)
- func (db *Database) CreateEventSubMessage(message EventSubMessage)
- func (db *Database) CreateNominationDownvote(ctx context.Context, downvote NominationDownvote) error
- func (db *Database) CreateNominationVote(ctx context.Context, vote NominationVote) error
- func (db *Database) CreateOrIncrementNomination(ctx context.Context, nomination Nomination) error
- func (db *Database) DeleteChannelPointReward(userID string, rewardType dto.RewardType)
- func (db *Database) DeleteChannelPointRewardById(userID string, rewardID string)
- func (db *Database) DeleteEmoteBlock(channelTwitchID string, emoteId string, emoteType dto.RewardType) error
- func (db *Database) DeleteOverlay(ID string)
- func (db *Database) DeletePermission(channelID string, userID string)
- func (db *Database) GetActivePrediction(ownerTwitchID string) (PredictionLog, error)
- func (db *Database) GetAllJoinBotConfigs() []BotConfig
- func (db *Database) GetAllMediaCommandsBotConfig() []BotConfig
- func (db *Database) GetAllPredictionSubscriptions(userID string) []EventSubSubscription
- func (db *Database) GetAllSubscriptions() []EventSubSubscription
- func (db *Database) GetAllUserAccessToken() []UserAccessToken
- func (db *Database) GetAppAccessToken() (AppAccessToken, error)
- func (db *Database) GetAsset(ID string) *Asset
- func (db *Database) GetBotConfig(userID string) (BotConfig, error)
- func (db *Database) GetBttvToken(ctx context.Context) string
- func (db *Database) GetChannelPermissions(channelID string) []Permission
- func (db *Database) GetChannelPointReward(userID string, rewardType dto.RewardType) (ChannelPointReward, error)
- func (db *Database) GetChannelPointRewards(userID string) []ChannelPointReward
- func (db *Database) GetChannelUserPermissions(userID string, channelID string) Permission
- func (db *Database) GetConfigValue(ctx context.Context, configKey string) string
- func (db *Database) GetDistinctRewardsPerUser() []ChannelPointReward
- func (db *Database) GetEmoteAdd(channelTwitchID string, emoteID string) *EmoteAdd
- func (db *Database) GetEmoteAdded(channelTwitchID string, addType dto.RewardType, limit int) []EmoteAdd
- func (db *Database) GetEmoteBlocks(channelTwitchID string, page int, pageSize int) []EmoteBlock
- func (db *Database) GetEmoteHistory(ctx context.Context, ownerTwitchID string, page int, pageSize int, added bool) []EmoteAdd
- func (db *Database) GetEnabledChannelPointRewardByID(rewardID string) (ChannelPointReward, error)
- func (db *Database) GetEventSubMessage(id string) (EventSubMessage, error)
- func (db *Database) GetNomination(ctx context.Context, channelTwitchID string, emoteID string) (Nomination, error)
- func (db *Database) GetNominations(ctx context.Context, channelTwitchID string) ([]Nomination, error)
- func (db *Database) GetOutcomes(predictionID string) []PredictionLogOutcome
- func (db *Database) GetOverlay(ID string, userID string) Overlay
- func (db *Database) GetOverlayByRoomId(roomID string) Overlay
- func (db *Database) GetOverlays(userID string) []Overlay
- func (db *Database) GetPredictions(ctx context.Context, ownerTwitchID string, page int, pageSize int) []PredictionLog
- func (db *Database) GetSevenTvToken(ctx context.Context) string
- func (db *Database) GetUserAccessToken(userID string) (UserAccessToken, error)
- func (db *Database) GetUserPermissions(userID string) []Permission
- func (db *Database) HasEventSubSubscription(subscriptionID string) bool
- func (s *Database) IsAlreadyNominated(ctx context.Context, channelTwitchID string, emoteID string) (bool, error)
- func (db *Database) IsEmoteBlocked(channelTwitchID string, emoteID string, emoteType dto.RewardType) bool
- func (db *Database) Migrate()
- func (db *Database) RemoveEmoteAdd(channelTwitchID string, emoteID string)
- func (db *Database) RemoveEventSubSubscription(subscriptionID string)
- func (s *Database) RemoveNomination(ctx context.Context, channelTwitchID string, emoteID string) error
- func (db *Database) RemoveNominationDownvote(ctx context.Context, downvote NominationDownvote) error
- func (db *Database) RemoveNominationVote(ctx context.Context, vote NominationVote) error
- func (db *Database) Save(ctx context.Context, configKey string, configValue string) error
- func (db *Database) SaveAppAccessToken(ctx context.Context, accessToken string, refreshToken string, scopes string, ...) error
- func (db *Database) SaveBotConfig(ctx context.Context, botCfg BotConfig) error
- func (db *Database) SaveOutcome(log PredictionLogOutcome) error
- func (db *Database) SaveOverlay(overlay Overlay) error
- func (db *Database) SavePermission(permission Permission) error
- func (db *Database) SavePrediction(log PredictionLog) error
- func (db *Database) SaveReward(reward ChannelPointReward) error
- func (db *Database) SaveUserAccessToken(ctx context.Context, ownerId string, accessToken string, refreshToken string, ...) error
- type EmoteAdd
- type EmoteBlock
- type EventSubMessage
- type EventSubSubscription
- type MockStore
- func (s *MockStore) ClearNominationEmote(ctx context.Context, channelTwitchID string, emoteID string) error
- func (s *MockStore) ClearNominations(ctx context.Context, channelTwitchID string) error
- func (s *MockStore) CountNominationDownvotes(ctx context.Context, channelTwitchID string, voteBy string) (int, error)
- func (s *MockStore) CountNominationVotes(ctx context.Context, channelTwitchID string, voteBy string) (int, error)
- func (s *MockStore) CountNominations(ctx context.Context, channelTwitchID string, userID string) (int, error)
- func (s *MockStore) CreateEmoteAdd(channelUserId string, rewardType dto.RewardType, emoteID string, ...)
- func (s *MockStore) CreateNominationDownvote(ctx context.Context, downvote NominationDownvote) error
- func (s *MockStore) CreateNominationVote(ctx context.Context, vote NominationVote) error
- func (s *MockStore) CreateOrIncrementNomination(ctx context.Context, nomination Nomination) error
- func (s *MockStore) DeleteChannelPointRewardById(userID string, rewardID string)
- func (s *MockStore) DeleteOverlay(ID string)
- func (s *MockStore) GetAllMediaCommandsBotConfig() []BotConfig
- func (s *MockStore) GetAllUserAccessToken() []UserAccessToken
- func (s *MockStore) GetAppAccessToken() (AppAccessToken, error)
- func (s *MockStore) GetBttvToken(ctx context.Context) string
- func (s *MockStore) GetChannelPointReward(userID string, rewardType dto.RewardType) (ChannelPointReward, error)
- func (s *MockStore) GetEmoteAdded(channelUserID string, rewardType dto.RewardType, slots int) []EmoteAdd
- func (s *MockStore) GetNomination(ctx context.Context, channelTwitchID string, emoteID string) (Nomination, error)
- func (s *MockStore) GetNominations(ctx context.Context, channelTwitchID string) ([]Nomination, error)
- func (s *MockStore) GetOverlay(ID string, userID string) Overlay
- func (s *MockStore) GetOverlayByRoomId(roomID string) Overlay
- func (s *MockStore) GetOverlays(userID string) []Overlay
- func (s *MockStore) GetSevenTvToken(ctx context.Context) string
- func (s *MockStore) GetUserAccessToken(userID string) (UserAccessToken, error)
- func (s *MockStore) IsAlreadyNominated(ctx context.Context, channelTwitchID string, emoteID string) (bool, error)
- func (s *MockStore) IsEmoteBlocked(channelUserID string, emoteID string, rewardType dto.RewardType) bool
- func (s *MockStore) RemoveNomination(ctx context.Context, channelTwitchID string, emoteID string) error
- func (s *MockStore) RemoveNominationDownvote(ctx context.Context, downvote NominationDownvote) error
- func (s *MockStore) RemoveNominationVote(ctx context.Context, vote NominationVote) error
- func (s *MockStore) SaveAppAccessToken(ctx context.Context, accessToken string, refreshToken string, scopes string, ...) error
- func (s *MockStore) SaveOverlay(overlay Overlay) error
- func (s *MockStore) SaveReward(reward ChannelPointReward) error
- func (s *MockStore) SaveUserAccessToken(ctx context.Context, ownerId string, accessToken string, refreshToken string, ...) error
- type Nomination
- type NominationDownvote
- type NominationVote
- type Overlay
- type Permission
- type PredictionLog
- type PredictionLogOutcome
- type Store
- type SystemConfig
- type UserAccessToken
Constants ¶
View Source
const ( PREDICTION_RESOLVED = "resolved" PREDICTION_CANCELED = "canceled" )
Variables ¶
This section is empty.
Functions ¶
func StructToMap ¶
Types ¶
type AppAccessToken ¶
type ChannelPointReward ¶
type ChannelPointReward struct { OwnerTwitchID string `gorm:"primaryKey"` Type dto.RewardType `gorm:"primaryKey"` RewardID string `gorm:"index"` ApproveOnly bool `gorm:"default:false"` CreatedAt time.Time UpdatedAt time.Time Title string Prompt string Cost int BackgroundColor string IsMaxPerStreamEnabled bool MaxPerStream int IsUserInputRequired bool IsMaxPerUserPerStreamEnabled bool MaxPerUserPerStream int IsGlobalCooldownEnabled bool GlobalCooldownSeconds int ShouldRedemptionsSkipRequestQueue bool Enabled bool AdditionalOptions string }
type Database ¶
func NewDatabase ¶
func (*Database) AddEventSubSubscription ¶
func (*Database) BlockEmoteAdd ¶
func (*Database) BlockEmotes ¶
func (*Database) ClearNominationEmote ¶
func (*Database) ClearNominations ¶
func (*Database) CountNominationDownvotes ¶
func (*Database) CountNominationVotes ¶
func (*Database) CountNominations ¶
func (*Database) CreateAsset ¶
func (*Database) CreateEmoteAdd ¶
func (db *Database) CreateEmoteAdd(channelTwitchID string, addType dto.RewardType, emoteID string, emoteChangeType dto.EmoteChangeType)
func (*Database) CreateEventSubMessage ¶
func (db *Database) CreateEventSubMessage(message EventSubMessage)
func (*Database) CreateNominationDownvote ¶
func (db *Database) CreateNominationDownvote(ctx context.Context, downvote NominationDownvote) error
func (*Database) CreateNominationVote ¶
func (db *Database) CreateNominationVote(ctx context.Context, vote NominationVote) error
func (*Database) CreateOrIncrementNomination ¶
func (db *Database) CreateOrIncrementNomination(ctx context.Context, nomination Nomination) error
func (*Database) DeleteChannelPointReward ¶
func (db *Database) DeleteChannelPointReward(userID string, rewardType dto.RewardType)
func (*Database) DeleteChannelPointRewardById ¶
func (*Database) DeleteEmoteBlock ¶
func (*Database) DeleteOverlay ¶
func (*Database) DeletePermission ¶
func (*Database) GetActivePrediction ¶
func (db *Database) GetActivePrediction(ownerTwitchID string) (PredictionLog, error)
func (*Database) GetAllJoinBotConfigs ¶
func (*Database) GetAllMediaCommandsBotConfig ¶
func (*Database) GetAllPredictionSubscriptions ¶
func (db *Database) GetAllPredictionSubscriptions(userID string) []EventSubSubscription
func (*Database) GetAllSubscriptions ¶
func (db *Database) GetAllSubscriptions() []EventSubSubscription
func (*Database) GetAllUserAccessToken ¶
func (db *Database) GetAllUserAccessToken() []UserAccessToken
func (*Database) GetAppAccessToken ¶
func (db *Database) GetAppAccessToken() (AppAccessToken, error)
func (*Database) GetChannelPermissions ¶
func (db *Database) GetChannelPermissions(channelID string) []Permission
func (*Database) GetChannelPointReward ¶
func (db *Database) GetChannelPointReward(userID string, rewardType dto.RewardType) (ChannelPointReward, error)
func (*Database) GetChannelPointRewards ¶
func (db *Database) GetChannelPointRewards(userID string) []ChannelPointReward
func (*Database) GetChannelUserPermissions ¶
func (db *Database) GetChannelUserPermissions(userID string, channelID string) Permission
func (*Database) GetConfigValue ¶
func (*Database) GetDistinctRewardsPerUser ¶
func (db *Database) GetDistinctRewardsPerUser() []ChannelPointReward
func (*Database) GetEmoteAdd ¶
func (*Database) GetEmoteAdded ¶
func (*Database) GetEmoteBlocks ¶
func (db *Database) GetEmoteBlocks(channelTwitchID string, page int, pageSize int) []EmoteBlock
func (*Database) GetEmoteHistory ¶
func (*Database) GetEnabledChannelPointRewardByID ¶
func (db *Database) GetEnabledChannelPointRewardByID(rewardID string) (ChannelPointReward, error)
func (*Database) GetEventSubMessage ¶
func (db *Database) GetEventSubMessage(id string) (EventSubMessage, error)
func (*Database) GetNomination ¶
func (*Database) GetNominations ¶
func (*Database) GetOutcomes ¶
func (db *Database) GetOutcomes(predictionID string) []PredictionLogOutcome
func (*Database) GetOverlayByRoomId ¶
func (*Database) GetOverlays ¶
func (*Database) GetPredictions ¶
func (*Database) GetUserAccessToken ¶
func (db *Database) GetUserAccessToken(userID string) (UserAccessToken, error)
func (*Database) GetUserPermissions ¶
func (db *Database) GetUserPermissions(userID string) []Permission
func (*Database) HasEventSubSubscription ¶
func (*Database) IsAlreadyNominated ¶
func (*Database) IsEmoteBlocked ¶
func (*Database) RemoveEmoteAdd ¶
func (*Database) RemoveEventSubSubscription ¶
func (*Database) RemoveNomination ¶
func (*Database) RemoveNominationDownvote ¶
func (db *Database) RemoveNominationDownvote(ctx context.Context, downvote NominationDownvote) error
func (*Database) RemoveNominationVote ¶
func (db *Database) RemoveNominationVote(ctx context.Context, vote NominationVote) error
func (*Database) SaveAppAccessToken ¶
func (*Database) SaveBotConfig ¶
func (*Database) SaveOutcome ¶
func (db *Database) SaveOutcome(log PredictionLogOutcome) error
func (*Database) SaveOverlay ¶
func (*Database) SavePermission ¶
func (db *Database) SavePermission(permission Permission) error
func (*Database) SavePrediction ¶
func (db *Database) SavePrediction(log PredictionLog) error
func (*Database) SaveReward ¶
func (db *Database) SaveReward(reward ChannelPointReward) error
type EmoteAdd ¶
type EmoteAdd struct { gorm.Model ID uint `gorm:"primarykey,autoIncrement"` ChannelTwitchID string `gorm:"index"` Type dto.RewardType `gorm:"index"` ChangeType dto.EmoteChangeType `gorm:"index"` Blocked bool `gorm:"index"` EmoteID string }
type EmoteBlock ¶
type EventSubMessage ¶
type EventSubSubscription ¶
type MockStore ¶
type MockStore struct { }
func NewMockStore ¶
func NewMockStore() *MockStore
func (*MockStore) ClearNominationEmote ¶
func (*MockStore) ClearNominations ¶
func (*MockStore) CountNominationDownvotes ¶
func (*MockStore) CountNominationVotes ¶
func (*MockStore) CountNominations ¶
func (*MockStore) CreateEmoteAdd ¶
func (s *MockStore) CreateEmoteAdd(channelUserId string, rewardType dto.RewardType, emoteID string, changeType dto.EmoteChangeType)
func (*MockStore) CreateNominationDownvote ¶
func (s *MockStore) CreateNominationDownvote(ctx context.Context, downvote NominationDownvote) error
func (*MockStore) CreateNominationVote ¶
func (s *MockStore) CreateNominationVote(ctx context.Context, vote NominationVote) error
func (*MockStore) CreateOrIncrementNomination ¶
func (s *MockStore) CreateOrIncrementNomination(ctx context.Context, nomination Nomination) error
func (*MockStore) DeleteChannelPointRewardById ¶
func (*MockStore) DeleteOverlay ¶
func (*MockStore) GetAllMediaCommandsBotConfig ¶
func (*MockStore) GetAllUserAccessToken ¶
func (s *MockStore) GetAllUserAccessToken() []UserAccessToken
func (*MockStore) GetAppAccessToken ¶
func (s *MockStore) GetAppAccessToken() (AppAccessToken, error)
func (*MockStore) GetChannelPointReward ¶
func (s *MockStore) GetChannelPointReward(userID string, rewardType dto.RewardType) (ChannelPointReward, error)
func (*MockStore) GetEmoteAdded ¶
func (*MockStore) GetNomination ¶
func (*MockStore) GetNominations ¶
func (*MockStore) GetOverlayByRoomId ¶
func (*MockStore) GetOverlays ¶
func (*MockStore) GetUserAccessToken ¶
func (s *MockStore) GetUserAccessToken(userID string) (UserAccessToken, error)
func (*MockStore) IsAlreadyNominated ¶
func (*MockStore) IsEmoteBlocked ¶
func (*MockStore) RemoveNomination ¶
func (*MockStore) RemoveNominationDownvote ¶
func (s *MockStore) RemoveNominationDownvote(ctx context.Context, downvote NominationDownvote) error
func (*MockStore) RemoveNominationVote ¶
func (s *MockStore) RemoveNominationVote(ctx context.Context, vote NominationVote) error
func (*MockStore) SaveAppAccessToken ¶
func (*MockStore) SaveOverlay ¶
func (*MockStore) SaveReward ¶
func (s *MockStore) SaveReward(reward ChannelPointReward) error
type Nomination ¶
type Nomination struct { EmoteID string `gorm:"primarykey"` ChannelTwitchID string `gorm:"primarykey"` EmoteCode string NominatedBy string CreatedAt time.Time UpdatedAt time.Time Votes []NominationVote `gorm:"foreignKey:EmoteID,ChannelTwitchID;references:EmoteID,ChannelTwitchID"` Downvotes []NominationDownvote `gorm:"foreignKey:EmoteID,ChannelTwitchID;references:EmoteID,ChannelTwitchID"` }
type NominationDownvote ¶
type NominationVote ¶
type Permission ¶
type PredictionLog ¶
type PredictionLogOutcome ¶
type PredictionLogOutcome struct { ID string `gorm:"primaryKey"` PredictionID string `gorm:"index"` Title string Color string Users int ChannelPoints int }
func (*PredictionLogOutcome) GetColorEmoji ¶
func (o *PredictionLogOutcome) GetColorEmoji() string
type Store ¶
type Store interface { IsEmoteBlocked(channelUserID string, emoteID string, rewardType dto.RewardType) bool GetEmoteAdded(channelUserID string, rewardType dto.RewardType, slots int) []EmoteAdd CreateEmoteAdd(channelUserId string, rewardType dto.RewardType, emoteID string, changeType dto.EmoteChangeType) GetUserAccessToken(userID string) (UserAccessToken, error) GetAppAccessToken() (AppAccessToken, error) SaveAppAccessToken(ctx context.Context, accessToken string, refreshToken string, scopes string, expiresIn int) error SaveUserAccessToken(ctx context.Context, ownerId string, accessToken string, refreshToken string, scopes string) error GetAllUserAccessToken() []UserAccessToken GetSevenTvToken(ctx context.Context) string GetBttvToken(ctx context.Context) string SaveReward(reward ChannelPointReward) error CreateOrIncrementNomination(ctx context.Context, nomination Nomination) error GetNominations(ctx context.Context, channelTwitchID string) ([]Nomination, error) ClearNominations(ctx context.Context, channelTwitchID string) error ClearNominationEmote(ctx context.Context, channelTwitchID string, emoteID string) error DeleteChannelPointRewardById(userID string, rewardID string) GetChannelPointReward(userID string, rewardType dto.RewardType) (ChannelPointReward, error) CreateNominationVote(ctx context.Context, vote NominationVote) error RemoveNominationVote(ctx context.Context, vote NominationVote) error GetNomination(ctx context.Context, channelTwitchID string, emoteID string) (Nomination, error) RemoveNomination(ctx context.Context, channelTwitchID string, emoteID string) error CountNominations(ctx context.Context, channelTwitchID string, userID string) (int, error) CreateNominationDownvote(ctx context.Context, downvote NominationDownvote) error RemoveNominationDownvote(ctx context.Context, downvote NominationDownvote) error CountNominationDownvotes(ctx context.Context, channelTwitchID string, voteBy string) (int, error) CountNominationVotes(ctx context.Context, channelTwitchID string, voteBy string) (int, error) IsAlreadyNominated(ctx context.Context, channelTwitchID string, emoteID string) (bool, error) GetOverlays(userID string) []Overlay GetOverlay(ID string, userID string) Overlay GetOverlayByRoomId(roomID string) Overlay DeleteOverlay(ID string) SaveOverlay(overlay Overlay) error }
type SystemConfig ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.